diff --git a/core/modules/system/lib/Drupal/system/Controller/ThemeController.php b/core/modules/system/lib/Drupal/system/Controller/ThemeController.php
new file mode 100644
index 0000000..6f60f25
--- /dev/null
+++ b/core/modules/system/lib/Drupal/system/Controller/ThemeController.php
@@ -0,0 +1,74 @@
+<?php
+
+/**
+ * @file
+ * Definition of \Drupal\system\Controller\ThemeController.
+ */
+
+namespace Drupal\system\Controller;
+
+use Drupal\Core\Controller\ControllerInterface;
+use Symfony\Component\DependencyInjection\ContainerInterface;
+use Symfony\Component\HttpFoundation\Request;
+use Symfony\Component\HttpFoundation\Response;
+use Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException;
+
+/**
+ * Controller for theme handling.
+ */
+class ThemeController implements ControllerInterface {
+
+  /**
+   * @var \Drupal\Core\Config\ConfigFactory|ConfigFactory
+   */
+  protected $configFactory;
+
+  /**
+   * Constructs a \Drupal\system\Controller\ThemeController object.
+   *
+   * @param \Drupal\Core\Config\ConfigFactory $config_factory
+   *   The factory for configuration objects.
+   *
+   */
+  public function __construct(ConfigFactory $config_factory) {
+    $this->configFactory = $config_factory;
+  }
+
+  /**
+   * @inheritdoc
+   */
+  public static function create(ContainerInterface $container) {
+    return new static ($container->get("config.factory"));
+  }
+
+  /**
+   * Disables a theme.
+   */
+  function disable(Request $request) {
+    $theme = $request->get('theme');
+    $token = $request->get('token');
+    if (isset($theme) && isset($token) && drupal_valid_token($token, 'system-theme-operation-link')) {
+      // Get current list of themes.
+      $themes = list_themes();
+      $config = $this->configFactory;
+
+      // Check if the specified theme is one recognized by the system.
+      if (!empty($themes[$theme])) {
+        // Do not disable the default or admin theme.
+        if ($theme === $config->get('default') || $theme === $config->get('admin')) {
+          drupal_set_message(t('%theme is the default theme and cannot be disabled.', array('%theme' => $themes[$theme]->info['name'])), 'error');
+        }
+        else {
+          theme_disable(array($theme));
+          drupal_set_message(t('The %theme theme has been disabled.', array('%theme' => $themes[$theme]->info['name'])));
+        }
+      }
+      else {
+        drupal_set_message(t('The %theme theme was not found.', array('%theme' => $theme)), 'error');
+      }
+      drupal_goto('admin/appearance');
+    }
+
+    throw new AccessDeniedHttpException();
+  }
+}
diff --git a/core/modules/system/system.admin.inc b/core/modules/system/system.admin.inc
index 1566c80..b6552df 100644
--- a/core/modules/system/system.admin.inc
+++ b/core/modules/system/system.admin.inc
@@ -307,33 +307,7 @@ function system_theme_enable() {
   throw new AccessDeniedHttpException();
 }
 
-/**
- * Menu callback; Disables a theme.
- */
-function system_theme_disable() {
-  if (isset($_REQUEST['theme']) && isset($_REQUEST['token']) && drupal_valid_token($_REQUEST['token'], 'system-theme-operation-link')) {
-    $theme = $_REQUEST['theme'];
-    // Get current list of themes.
-    $themes = list_themes();
 
-    // Check if the specified theme is one recognized by the system.
-    if (!empty($themes[$theme])) {
-      // Do not disable the default or admin theme.
-      if ($theme === config('system.theme')->get('default') || $theme === config('system.theme')->get('admin')) {
-        drupal_set_message(t('%theme is the default theme and cannot be disabled.', array('%theme' => $themes[$theme]->info['name'])), 'error');
-      }
-      else {
-        theme_disable(array($theme));
-        drupal_set_message(t('The %theme theme has been disabled.', array('%theme' => $themes[$theme]->info['name'])));
-      }
-    }
-    else {
-      drupal_set_message(t('The %theme theme was not found.', array('%theme' => $theme)), 'error');
-    }
-    drupal_goto('admin/appearance');
-  }
-  throw new AccessDeniedHttpException();
-}
 
 /**
  * Menu callback; Set the default theme.
diff --git a/core/modules/system/system.module b/core/modules/system/system.module
index 0d472e5..93919bf 100644
--- a/core/modules/system/system.module
+++ b/core/modules/system/system.module
@@ -711,10 +711,8 @@ function system_menu() {
   );
   $items['admin/appearance/disable'] = array(
     'title' => 'Disable theme',
-    'page callback' => 'system_theme_disable',
-    'access arguments' => array('administer themes'),
+    'route_name' => 'system_theme_disable',
     'type' => MENU_CALLBACK,
-    'file' => 'system.admin.inc',
   );
   $items['admin/appearance/default'] = array(
     'title' => 'Set default theme',
diff --git a/core/modules/system/system.routing.yml b/core/modules/system/system.routing.yml
index 9859d6a..93e7083 100644
--- a/core/modules/system/system.routing.yml
+++ b/core/modules/system/system.routing.yml
@@ -74,6 +74,14 @@ system_site_maintenance_mode:
   requirements:
     _permission: 'administer site configuration'
 
+system_theme_disable:
+  pattern: '/admin/appearance/disable'
+  defaults:
+    _controller: 'Drupal\system\Controller\ThemeController::disable'
+  requirements:
+    _permission: 'administer themes'
+
+
 date_format_delete:
   pattern: 'admin/config/regional/date-time/formats/{format_id}/delete'
   defaults:
