diff --git a/queue_ui.module b/queue_ui.module
index 1dbce06..b4578e7 100644
--- a/queue_ui.module
+++ b/queue_ui.module
@@ -56,13 +56,6 @@ function queue_ui_menu() {
 }
 
 /**
- * Wildcard loader for queue_ui_queue.
- */
-function queue_ui_queue_load($name) {
-  return Drupal::queue($name);
-}
-
-/**
  * Wildcard loader for queue item.
  *
  * @param $queue_item
@@ -104,39 +97,6 @@ function _queue_ui_queueclass($queue_name){
 }
 
 /**
- * Get the names of queues.
- *
- * @param Array of queue names suitable for Drupal::queue();
- */
-function queue_ui_queue_names() {
-  $result = db_query("SELECT DISTINCT name FROM {queue}");
-  return $result->fetchAll();
-}
-
-/**
- * Get queues.
- *
- * @return Array of queues indexed by name and containing queue object and number
- * of items.
- */
-function queue_ui_queues() {
-  $queues = array();
-  $queue_names = queue_ui_queue_names();
-  if (!empty($queue_names)) {
-    // Build array of queues indexed by name with number of items.
-    foreach ($queue_names as $name) {
-      $queue = Drupal::queue($name->name);
-      $class = get_class($queue);
-      $queues[$class][$name->name] = array(
-        'queue' => $queue,
-        'items' => $queue->numberOfItems(),
-      );
-    }
-  }
-  return $queues;
-}
-
-/**
  * Get queues defined by QueueWorker plugins.
  *
  * @return Array of queues indexed by name and containing
@@ -159,20 +119,3 @@ function queue_ui_queue_info_alter(&$queues) {
     }
   }
 }
-
-function _queue_ui_array_keys_contain($input, $search_value, $strict = FALSE) {
-  $tmpkeys = array();
-
-  $keys = array_keys($input);
-
-  foreach ($keys as $k) {
-    if ($strict && strpos($k, $search_value) !== FALSE) {
-      $tmpkeys[] = $k;
-    }
-    elseif (!$strict && stripos($k, $search_value) !== FALSE) {
-      $tmpkeys[] = $k;
-    }
-  }
-
-  return $tmpkeys;
-}
diff --git a/src/Form/QueueUIOverviewForm.php b/src/Form/QueueUIOverviewForm.php
index 771d6d5..87755c8 100644
--- a/src/Form/QueueUIOverviewForm.php
+++ b/src/Form/QueueUIOverviewForm.php
@@ -2,6 +2,8 @@
 
 namespace Drupal\queue_ui\Form;
 
+use Drupal\Core\Queue\QueueFactory;
+use Drupal\Core\Queue\QueueInterface;
 use Drupal\Core\Session\AccountInterface;
 use Drupal\Core\State\State;
 use Drupal\user\PrivateTempStoreFactory;
@@ -12,6 +14,13 @@ use Drupal\Core\Form\FormStateInterface;
 class QueueUIOverviewForm extends FormBase {
 
   /**
+   * The queue factory.
+   *
+   * @var \Drupal\Core\Queue\QueueFactory
+   */
+  protected $queueFactory;
+
+  /**
    * The tempstore factory.
    *
    * @var \Drupal\user\PrivateTempStoreFactory
@@ -33,11 +42,13 @@ class QueueUIOverviewForm extends FormBase {
   protected $state;
 
   /**
+   * @param \Drupal\Core\Queue\QueueFactory $queue_factory
    * @param \Drupal\user\PrivateTempStoreFactory $temp_store_factory
    * @param \Drupal\Core\Session\AccountInterface $current_user
    * @param \Drupal\Core\State\State $state
    */
-  public function __construct(PrivateTempStoreFactory $temp_store_factory, AccountInterface $current_user, State $state) {
+  public function __construct(QueueFactory $queue_factory, PrivateTempStoreFactory $temp_store_factory, AccountInterface $current_user, State $state) {
+    $this->queueFactory = $queue_factory;
     $this->tempStoreFactory = $temp_store_factory;
     $this->currentUser = $current_user;
     $this->state = $state;
@@ -46,6 +57,7 @@ class QueueUIOverviewForm extends FormBase {
 
   public static function create(ContainerInterface $container) {
     return new static(
+      $container->get('queue'),
       $container->get('user.private_tempstore'),
       $container->get('current_user'),
       $container->get('state')
@@ -61,54 +73,48 @@ class QueueUIOverviewForm extends FormBase {
     // @todo activation status
 
     $header = array(
-      'name' => t('Name'),
       'title' => t('Title'),
       'items' => t('Number of items'),
       'class' => t('Class'),
       'cron' => t('Time limit per cron run'),
 //      'inspect' => t('Inspect'),
     );
-    // Get queues defined via our hook.
+    // Get queues defined by plugins.
     $defined_queues = queue_ui_defined_queues();
     // Get queues names.
-    $queues = queue_ui_queues();
 
-    foreach ($queues as $class => $classed_queues) {
-      $options = array();
 
-      // Get the classname from the full namespace
-      $namespace = explode('\\', $class);
+    $options = array();
+    foreach ($defined_queues as $name => $queue_definition) {
+      /** @var QueueInterface $queue */
+      $queue = $this->queueFactory->get($name);
+
+      $namespace = explode('\\', get_class($queue));
       $class_name = array_pop($namespace);
 
 //      $class_info = QueueUI::get('Drupal\queue_ui\QueueUI' . $class_name);
 
-      // Output information for each queue of the current class
-      foreach($classed_queues as $name => $queue) {
-        $title = '';
-        $inspect = FALSE;
+      $inspect = FALSE;
 
-        if (isset($defined_queues[$name])) {
-          $title = (string)$defined_queues[$name]['title'];
+      $title = (string)$queue_definition['title'];
 
-          if (isset($defined_queues[$name]['cron']['time']) && $defined_queues[$name]['cron']['time'] != 0) {
-            $cron_time_limit = $this->formatPlural($defined_queues[$name]['cron']['time'], '@count second', '@count seconds');
-          }
-          else {
-            $cron_time_limit = $this->t('Off');
-          }
-        }
+      if (isset($queue_definition['cron']['time']) && $queue_definition['cron']['time'] != 0) {
+        $cron_time_limit = $this->formatPlural($queue_definition['cron']['time'], '@count second', '@count seconds');
+      }
+      else {
+        $cron_time_limit = $this->t('Off');
+      }
 
 //        if (is_object($class_info) && $class_info->inspect) {
 //          $inspect = TRUE;
 //        }
 
-        $options[$name] = array(
-          'name' => $name,
-          'title' => $title,
-          'items' => $queue['items'],
-          'class' => $class_name,
-          'cron' => $cron_time_limit,
-        );
+      $options[$name] = array(
+        'title' => $title,
+        'items' => $queue->numberOfItems(),
+        'class' => $class_name,
+        'cron' => $cron_time_limit,
+      );
 
 //        // If queue inspection is enabled for this class, add to the options array.
 //        if ($inspect) {
@@ -117,47 +123,40 @@ class QueueUIOverviewForm extends FormBase {
 //        else {
 //          $options[$name]['inspect'] = '';
 //        }
-      }
-
-      $form[$class_name] = array(
-        '#type' => 'fieldset',
-        '#collapsible' => TRUE,
-        '#title' => $class_name,
-      );
-
-      $form[$class_name]['queues_' . $class_name] = array(
-        '#type' => 'tableselect',
-        '#header' => $header,
-        '#options' => $options,
-        '#empty' => t('No queues exist for @class.', array('@class' => $class_name)),
-      );
     }
 
+    $form['queues'] = array(
+      '#type' => 'tableselect',
+      '#header' => $header,
+      '#options' => $options,
+      '#empty' => t('No queues defined'),
+    );
+
     // @todo deactivate options
     // Option to run batch.
     $form['batch'] = array(
       '#type' => 'submit',
       '#value' => t('Batch process'),
-      '#submit' => ['::submitForm', '::submitBatch'],
+      '#submit' => ['::submitBatch'],
     );
     // Option to remove lease timestamps.
     $form['release'] = array(
       '#type' => 'submit',
       '#value' => t('Remove leases'),
-      '#submit' => ['::submitForm', '::submitRelease'],
+      '#submit' => ['::submitRelease'],
     );
     // Option to run via cron.
     // @todo: Define a better way to set the time allocated for each queue.
 //    $form['cron'] = array(
 //      '#type' => 'submit',
 //      '#value' => t('Cron process'),
-//      '#submit' => ['::submitForm', '::submitCron'],
+//      '#submit' => ['::submitCron'],
 //    );
     // Option to delete queue.
     $form['delete'] = array(
       '#type' => 'submit',
-      '#value' => t('Delete queues'),
-      '#submit' => ['::submitForm', '::submitDelete'],
+      '#value' => t('Clear'),
+      '#submit' => ['::submitClear'],
     );
     // Specify our step submit callback.
     $form['step_submit'] = array('#type' => 'value', '#value' => 'queue_ui_overview_submit');
@@ -165,38 +164,15 @@ class QueueUIOverviewForm extends FormBase {
   }
 
   public function submitForm(array &$form, FormStateInterface $form_state) {
-
-    $values = $form_state->getValues();
-    $queue_classes = _queue_ui_array_keys_contain($values, 'queues');
-
-    $queues = array();
-
-    foreach ($queue_classes as $class_name) {
-      foreach ($values[$class_name] as $queue) {
-        $queues[] = $queue;
-      }
-    }
-    // Get submitted queues to act on.
-    $queues = array_filter($queues);
-
-    $form_state->set('queues', $queues);
-
-    if (empty($queues)) {
-      // Nothing to do.
-      return;
-    }
+    // We need this method, but each button has its own submit handler.
   }
 
   public function submitBatch(array &$form, FormStateInterface $form_state) {
-    drupal_set_message('Batch');
-
     // Process queue(s) with batch.
-    // We can only run batch on queues using our hook_queue_info() that define batch.
-    $defined_queues = queue_ui_defined_queues();
-    $intersect = array_intersect(array_keys($defined_queues), $form_state->get('queues'));
-    foreach ($intersect as $queue_name) {
+    $selected_queues = array_filter($form_state->getValue('queues'));
+    foreach ($selected_queues as $queue_name) {
 
-      $queue = \Drupal::queue($queue_name);
+      $queue = $this->queueFactory->get($queue_name);
 
       $batch = [
         'operations' => []
@@ -211,22 +187,18 @@ class QueueUIOverviewForm extends FormBase {
 
   public function submitCron(array &$form, FormStateInterface $form_state) {
 
-    // Set variables for cron to TRUE.
-    $defined_queues = queue_ui_defined_queues();
-    $intersect = array_intersect(array_keys($defined_queues), $form_state->get('queues'));
+    $selected_queues = array_filter($form_state->getValue('queues'));
 
-    foreach ($intersect as $name) {
-      if (isset($defined_queues[$name])) {
-        $this->state->set('queue_ui_cron_' . $name, 10);
-      }
+    foreach ($selected_queues as $name) {
+      $this->state->set('queue_ui_cron_' . $name, 10);
     }
 
     // Clear the cached plugin definition so that changes come into effect.
     \Drupal::service('plugin.manager.queue_worker')->clearCachedDefinitions();
   }
 
-  public function submitDelete(array &$form, FormStateInterface $form_state) {
-    $queues = $form_state->get('queues');
+  public function submitClear(array &$form, FormStateInterface $form_state) {
+    $queues = array_filter($form_state->getValue('queues'));
 
     $this->tempStoreFactory->get('queue_ui_delete_queues')->set($this->currentUser->id(), $queues);
 
@@ -234,7 +206,8 @@ class QueueUIOverviewForm extends FormBase {
   }
 
   public function submitRelease(array &$form, FormStateInterface $form_state) {
-    foreach ($form_state->get('queues') as $name) {
+    $selected_queues = array_filter($form_state->getValue('queues'));
+    foreach ($selected_queues as $name) {
       $num_updated = db_update('queue')
         ->fields(array(
           'expire' => 0,
