diff --git a/restui.module b/restui.module
index 3d4fdab..2b418ad 100644
--- a/restui.module
+++ b/restui.module
@@ -24,7 +24,7 @@ function restui_theme() {
  */
 function restui_preprocess_restui_resource_info(&$variables) {
   $formats = \Drupal::getContainer()->getParameter('serializer.formats');
-  $authentication_providers = array_keys(\Drupal::service('restui.authentication_collector')->getSortedProviders());
+  $authentication_providers = array_keys(\Drupal::service('authentication_collector')->getSortedProviders());
   foreach ($variables['resource'] as $method => $properties) {
     if (empty($properties['supported_formats'])) {
       $variables['resource'][$method]['supported_formats'] = $formats;
diff --git a/restui.routing.yml b/restui.routing.yml
index a61cd86..3a0c33f 100644
--- a/restui.routing.yml
+++ b/restui.routing.yml
@@ -11,6 +11,7 @@ restui.disable:
     _controller: '\Drupal\restui\Controller\RestUIController::disable'
   requirements:
     _permission: 'administer rest resources'
+    _csrf_token: 'TRUE'
 
 restui.edit:
   path: '/admin/config/services/rest/resource/{resource_id}/edit'
diff --git a/restui.services.yml b/restui.services.yml
deleted file mode 100644
index 779da5e..0000000
--- a/restui.services.yml
+++ /dev/null
@@ -1,6 +0,0 @@
-services:
-
-  restui.authentication_collector:
-    class: Drupal\restui\RestUIAuthenticationCollector
-    tags:
-    - { name: service_collector, tag: authentication_provider, call: addProvider }
diff --git a/src/Controller/RestUIController.php b/src/Controller/RestUIController.php
index df451b0..2b631e4 100644
--- a/src/Controller/RestUIController.php
+++ b/src/Controller/RestUIController.php
@@ -170,7 +170,7 @@ class RestUIController implements ContainerInjectionInterface {
               ),
               'disable' => array(
                 'title' => t('Disable'),
-                'url' => Url::fromRoute('restui.disable', array('resource_id' => $id), array('query' => array('token' => \Drupal::csrfToken()->get('restui_disable')))),
+                'url' => Url::fromRoute('restui.disable', array('resource_id' => $id)),
               ),
               'permissions' => array(
                 'title' => t('Permissions'),
@@ -198,8 +198,6 @@ class RestUIController implements ContainerInjectionInterface {
    *
    * @param string $resource_id
    *   The identifier or the REST resource.
-   * @param \Symfony\Component\HttpFoundation\Request $request
-   *   The current request.
    *
    * @return \Drupal\Core\Ajax\AjaxResponse|\Symfony\Component\HttpFoundation\RedirectResponse
    *   Redirects back to the listing page.
@@ -207,14 +205,10 @@ class RestUIController implements ContainerInjectionInterface {
    * @throws \Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException
    *   Access is denied, if the token is invalid or missing.
    */
-  public function disable($resource_id, Request $request) {
-    if (!\Drupal::csrfToken()->validate($request->query->get('token'), 'restui_disable')) {
-      throw new AccessDeniedHttpException();
-    }
-
+  public function disable($resource_id) {
     $config = \Drupal::configFactory()->getEditable('rest.settings');
     $resources = $config->get('resources') ?: array();
-    $plugin = $this->resourcePluginManager->getInstance(array('id' => $resource_id));
+    $plugin = $this->resourcePluginManager->createInstance($resource_id);
     if (!empty($plugin)) {
       // disable the resource.
       unset($resources[$resource_id]);
diff --git a/src/Form/RestUIForm.php b/src/Form/RestUIForm.php
index 93606e5..2aea85a 100644
--- a/src/Form/RestUIForm.php
+++ b/src/Form/RestUIForm.php
@@ -2,6 +2,7 @@
 
 namespace Drupal\restui\Form;
 
+use Drupal\Core\Authentication\AuthenticationCollectorInterface;
 use Drupal\Core\Form\ConfigFormBase;
 use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Config\ConfigFactoryInterface;
@@ -13,7 +14,7 @@ use Drupal\rest\Plugin\Type\ResourcePluginManager;
 use Drupal\Core\Routing\RouteBuilderInterface;
 
 /**
- * Manage REST resources.
+ * Provides a REST resource configuration form.
  */
 class RestUIForm extends ConfigFormBase {
 
@@ -25,11 +26,11 @@ class RestUIForm extends ConfigFormBase {
   protected $moduleHandler;
 
   /**
-   * The available Authentication Providers.
+   * The authentication collector.
    *
-   * @var array
+   * @var \Drupal\Core\Authentication\AuthenticationCollectorInterface
    */
-  protected $authenticationProviders;
+  protected $authenticationCollector;
 
   /**
    * The available serialization formats.
@@ -54,11 +55,24 @@ class RestUIForm extends ConfigFormBase {
 
   /**
    * Constructs a \Drupal\user\RestForm object.
+   *
+   * @param \Drupal\Core\Config\ConfigFactoryInterface $config_factory
+   *   The config factory.
+   * @param \Drupal\Core\Extension\ModuleHandler $module_handler
+   *   The module handler.
+   * @param \Drupal\Core\Authentication\AuthenticationCollectorInterface $authentication_collector
+   *   The authentication collector.
+   * @param array $formats
+   *   The available serialization formats.
+   * @param \Drupal\rest\Plugin\Type\ResourcePluginManager $resourcePluginManager
+   *   The REST plugin manager.
+   * @param \Drupal\Core\Routing\RouteBuilderInterface $routeBuilder
+   *   The route builder.
    */
-  public function __construct(ConfigFactoryInterface $config_factory, ModuleHandler $module_handler, array $authenticationProviders, array $formats, ResourcePluginManager $resourcePluginManager, RouteBuilderInterface $routeBuilder) {
+  public function __construct(ConfigFactoryInterface $config_factory, ModuleHandler $module_handler, AuthenticationCollectorInterface $authentication_collector, array $formats, ResourcePluginManager $resourcePluginManager, RouteBuilderInterface $routeBuilder) {
     parent::__construct($config_factory);
     $this->moduleHandler = $module_handler;
-    $this->authenticationProviders = $authenticationProviders;
+    $this->authenticationCollector = $authentication_collector;
     $this->formats = $formats;
     $this->resourcePluginManager = $resourcePluginManager;
     $this->routeBuilder= $routeBuilder;
@@ -71,7 +85,7 @@ class RestUIForm extends ConfigFormBase {
     return new static(
       $container->get('config.factory'),
       $container->get('module_handler'),
-      array_keys($container->get('restui.authentication_collector')->getSortedProviders()),
+      $container->get('authentication_collector'),
       $container->getParameter('serializer.formats'),
       $container->get('plugin.manager.rest'),
       $container->get('router.builder')
@@ -79,7 +93,7 @@ class RestUIForm extends ConfigFormBase {
   }
 
   /**
-   * Implements \Drupal\Core\Form\FormInterface::getFormID().
+   * {@inheritdoc}
    */
   public function getFormID() {
     return 'restui';
@@ -95,21 +109,23 @@ class RestUIForm extends ConfigFormBase {
   }
 
   /**
-   * Implements \Drupal\Core\Form\FormInterface::buildForm().
+   * {@inheritdoc}
    *
    * @var array $form
    *   The form array.
-   * @var array $form_state
-   *   The $form_state array.
    * @param \Drupal\Core\Form\FormStateInterface $form_state
    *   The form state.
    * @var string $resource_id
    *   A string that identfies the REST resource.
    *
+   * @return array
+   *   The form structure.
+   *
    * @throws \Symfony\Component\HttpKernel\Exception\NotFoundHttpException
+   *   When no plugin found.
    */
   public function buildForm(array $form, FormStateInterface $form_state, $resource_id = NULL) {
-    $plugin = $this->resourcePluginManager->getInstance(array('id' => $resource_id));
+    $plugin = $this->resourcePluginManager->createInstance($resource_id);
     if (empty($plugin)) {
       throw new NotFoundHttpException();
     }
@@ -123,15 +139,15 @@ class RestUIForm extends ConfigFormBase {
       '#markup' => '<h2>' . t('Settings for resource @label', array('@label' => $pluginDefinition['label'])) . '</h2>',
     );
     $form['description'] = array(
-      '#markup' => '<p>' . t('Here you can restrict which HTTP methods should this resource support.' .
-                             ' And within each method, the available serialization formats and ' .
-                             'authentication providers.') . '</p>',
+      '#markup' => '<p>' . t('Here you can restrict which HTTP methods should this resource support. And within each method, the available serialization formats and authentication providers.') . '</p>',
     );
     $form['note'] = array(
       '#markup' => '<p>' . t('<b>Note:</b> Leaving all formats unchecked will enable all of them, while leaving all authentication providers unchecked will default to <code>cookie</code>') . '</p>',
     );
     $form['methods'] = array('#type' => 'container');
 
+    $authentication_providers = array_keys($this->authenticationCollector->getSortedProviders());
+    $authentication_providers = array_combine($authentication_providers, $authentication_providers);
     foreach ($methods as $method) {
       $group = array();
       $group[$method] = array(
@@ -163,9 +179,9 @@ class RestUIForm extends ConfigFormBase {
         $enabled_auth = $config[$resource_id][$method]['supported_auth'];
       }
       $group['settings']['auth'] = array(
-        '#title' => 'Authentication providers',
+        '#title' => $this->t('Authentication providers'),
         '#type' => 'checkboxes',
-        '#options' => array_combine($this->authenticationProviders, $this->authenticationProviders),
+        '#options' => $authentication_providers,
         '#multiple' => TRUE,
         '#default_value' => $enabled_auth,
       );
@@ -177,7 +193,7 @@ class RestUIForm extends ConfigFormBase {
   /**
    * {@inheritdoc}
    */
-  public function validateForm(array &$form, formstateinterface $form_state) {
+  public function validateForm(array &$form, FormStateInterface $form_state) {
     // At least one method must be checked.
     $method_checked = FALSE;
     foreach ($form_state->getValue('methods') as $method => $values) {
@@ -202,7 +218,7 @@ class RestUIForm extends ConfigFormBase {
   /**
    * {@inheritdoc}
    */
-  public function submitForm(array &$form, formstateinterface $form_state) {
+  public function submitForm(array &$form, FormStateInterface $form_state) {
     $methods = $form_state->getValue('methods');
     $resource_id = $form_state->getValue('resource_id');
     $resources = \Drupal::config('rest.settings')->get('resources') ?: array();
diff --git a/src/RestUIAuthenticationCollector.php b/src/RestUIAuthenticationCollector.php
deleted file mode 100644
index b96d192..0000000
--- a/src/RestUIAuthenticationCollector.php
+++ /dev/null
@@ -1,80 +0,0 @@
-<?php
-
-namespace Drupal\restui;
-
-use Drupal\Core\Authentication\AuthenticationProviderInterface;
-use Symfony\Component\HttpFoundation\Request;
-
-class RestUIAuthenticationCollector {
-
-  /**
-   * Array of all registered authentication providers, keyed by ID.
-   *
-   * @var \Drupal\Core\Authentication\AuthenticationProviderInterface[]
-   */
-  protected $providers;
-
-  /**
-   * Array of all providers and their priority.
-   *
-   * @var array
-   */
-  protected $providerOrders = array();
-
-  /**
-   * Sorted list of registered providers.
-   *
-   * @var \Drupal\Core\Authentication\AuthenticationProviderInterface[]
-   */
-  protected $sortedProviders;
-
-  /**
-   * {@inheritdoc}
-   */
-  public function addProvider(AuthenticationProviderInterface $provider, $provider_id, $priority = 0) {
-    $this->providers[$provider_id] = $provider;
-    $this->providerOrders[$priority][$provider_id] = $provider;
-    // Force the builders to be re-sorted.
-    $this->sortedProviders = NULL;
-  }
-
-  /**
-   * Returns the id of the authentication provider for a request.
-   *
-   * @param \Symfony\Component\HttpFoundation\Request $request
-   *   The incoming request.
-   *
-   * @return string|NULL
-   *   The id of the first authentication provider which applies to the request.
-   *   If no application detects appropriate credentials, then NULL is returned.
-   */
-  protected function getProvider(Request $request) {
-    foreach ($this->getSortedProviders() as $provider_id => $provider) {
-      if ($provider->applies($request)) {
-        return $provider_id;
-      }
-    }
-  }
-
-  /**
-   * Returns the sorted array of authentication providers.
-   *
-   * @todo Replace with a list of providers sorted during compile time in
-   *   https://www.drupal.org/node/2432585.
-   *
-   * @return \Drupal\Core\Authentication\AuthenticationProviderInterface[]
-   *   An array of authentication provider objects.
-   */
-  public function getSortedProviders() {
-    if (!isset($this->sortedProviders)) {
-      // Sort the builders according to priority.
-      krsort($this->providerOrders);
-      // Merge nested providers from $this->providers into $this->sortedProviders.
-      $this->sortedProviders = array();
-      foreach ($this->providerOrders as $providers) {
-        $this->sortedProviders = array_merge($this->sortedProviders, $providers);
-      }
-    }
-    return $this->sortedProviders;
-  }
-}
