diff --git a/lib/Drupal/maintenance200/EventSubscriber/MaintenanceModeSubscriber.php b/lib/Drupal/maintenance200/EventSubscriber/MaintenanceModeSubscriber.php
deleted file mode 100644
index 888477f..0000000
--- a/lib/Drupal/maintenance200/EventSubscriber/MaintenanceModeSubscriber.php
+++ /dev/null
@@ -1,32 +0,0 @@
-<?php
-
-namespace Drupal\maintenance200\EventSubscriber;
-
-use Symfony\Component\EventDispatcher\EventSubscriberInterface;
-use Symfony\Component\HttpKernel\Event\GetResponseEvent;
-use Symfony\Component\HttpKernel\KernelEvents;
-use Symfony\Component\HttpFoundation\Response;
-use Symfony\Component\HttpKernel\Event\FilterResponseEvent;
-
-class MaintenanceModeSubscriber implements EventSubscriberInterface {
-
-  public function onKernelResponse(FilterResponseEvent $event) {
-  	if (config('maintenance200.settings')->get('maintenance200_enabled')) {
-  	  $status_code = config('maintenance200.settings')->get('maintenance200_status_code');
-	    $request = $event->getRequest();
-	    $response = $event->getResponse();
-	    if ($request->attributes->get('_maintenance') == MENU_SITE_OFFLINE) {
-		    if (is_numeric($status_code)) {
-		      $response->setStatusCode($status_code);
-		      $event->setResponse($response);
-		    }
-	    }
-    }
-  }
-
-  public static function getSubscribedEvents() {
-    $events[KernelEvents::RESPONSE][] = array('onKernelResponse', 31);
-    return $events;
-  }
-
-}
diff --git a/lib/Drupal/maintenance200/Form/Maintenance200SettingsForm.php b/lib/Drupal/maintenance200/Form/Maintenance200SettingsForm.php
deleted file mode 100644
index cb37d6a..0000000
--- a/lib/Drupal/maintenance200/Form/Maintenance200SettingsForm.php
+++ /dev/null
@@ -1,114 +0,0 @@
-<?php
-
-namespace Drupal\maintenance200\Form;
-
-use Drupal\system\SystemConfigFormBase;
-
-class Maintenance200SettingsForm extends SystemConfigFormBase {
-
-	public function getFormID() {
-    return 'maintenance200_settings';
-  }
-
-	public function buildForm(array $form, array &$form_state) {
-		$form = parent::buildForm($form, $form_state);
-		$config = config('maintenance200.settings');
-		$form['explanation'] = array(
-			'#type' => 'markup',
-			'#markup' => 'Here, you can enable or disable the maintenance200 status code change functionality, and also set the status code that will be used if the functionality is enabled.'
-		);
-		$form['maintenance200_enabled'] = array(
-  		'#type' => 'checkbox',
-  		'#title' => t('Change the status code during maintenance mode'),
-  		'#default_value' => $config->get('maintenance200_enabled'),
-  	);
-		$form['maintenance200_status_code'] = array(
-  		'#type' => 'textfield',
-  		'#title' => t('Status code to use'),
-  		'#maxlength' => '3',
-  		'#size' => '3',
-  		'#required' => TRUE,
-  		'#description' => 'A valid HTTP status code is required. See the Wikipedia <a href="http://en.wikipedia.org/wiki/List_of_HTTP_status_codes">HTTP status codes</a> page for a complete list.',
-  		'#default_value' => $config->get('maintenance200_status_code'),
-  	);
-  	return parent::buildForm($form, $form_state);
-	}
-	
-	public function validateForm(array &$form, array &$form_state) {
-	  parent::validateForm($form, $form_state);
-	  if ($form_state['values']['maintenance200_status_code']) {
-	    $http_status_codes = array(
-				100 => 'Continue',
-				101 => 'Switching Protocols',
-				102 => 'Processing',
-				200 => 'OK',
-				201 => 'Created',
-				202 => 'Accepted',
-				203 => 'Non-Authoritative Information',
-				204 => 'No Content',
-				205 => 'Reset Content',
-				206 => 'Partial Content',
-				207 => 'Multi-Status',
-				300 => 'Multiple Choices',
-				301 => 'Moved Permanently',
-				302 => 'Found',
-				303 => 'See Other',
-				304 => 'Not Modified',
-				305 => 'Use Proxy',
-				306 => 'Switch Proxy',
-				307 => 'Temporary Redirect',
-				400 => 'Bad Request',
-				401 => 'Unauthorized',
-				402 => 'Payment Required',
-				403 => 'Forbidden',
-				404 => 'Not Found',
-				405 => 'Method Not Allowed',
-				406 => 'Not Acceptable',
-				407 => 'Proxy Authentication Required',
-				408 => 'Request Timeout',
-				409 => 'Conflict',
-				410 => 'Gone',
-				411 => 'Length Required',
-				412 => 'Precondition Failed',
-				413 => 'Request Entity Too Large',
-				414 => 'Request-URI Too Long',
-				415 => 'Unsupported Media Type',
-				416 => 'Requested Range Not Satisfiable',
-				417 => 'Expectation Failed',
-				418 => 'I\'m a teapot',
-				422 => 'Unprocessable Entity',
-				423 => 'Locked',
-				424 => 'Failed Dependency',
-				425 => 'Unordered Collection',
-				426 => 'Upgrade Required',
-				449 => 'Retry With',
-				450 => 'Blocked by Windows Parental Controls',
-				500 => 'Internal Server Error',
-				501 => 'Not Implemented',
-				502 => 'Bad Gateway',
-				503 => 'Service Unavailable',
-				504 => 'Gateway Timeout',
-				505 => 'HTTP Version Not Supported',
-				506 => 'Variant Also Negotiates',
-				507 => 'Insufficient Storage',
-				509 => 'Bandwidth Limit Exceeded',
-				510 => 'Not Extended'
-			);
-      if (!array_key_exists($form_state['values']['maintenance200_status_code'], $http_status_codes)) {
-	  		form_set_error('maintenance200_status_code', t('A valid HTTP status code is required.'));
-			}
-		} else {
-			form_set_error('maintenance200_status_code', t('You must provide an HTTP status code.'));
-		}
-	}
-	
-	public function submitForm(array &$form, array &$form_state) {
-		parent::submitForm($form, $form_state);
-		config('maintenance200.settings')
-			->set('maintenance200_enabled', $form_state['values']['maintenance200_enabled'])
-			->set('maintenance200_status_code', $form_state['values']['maintenance200_status_code'])
-			->save();
-		parent::submitForm($form, $form_state);
-	}
-  
-}
\ No newline at end of file
diff --git a/maintenance200.info.yml b/maintenance200.info.yml
index 6bcc468..3134f2e 100755
--- a/maintenance200.info.yml
+++ b/maintenance200.info.yml
@@ -2,4 +2,3 @@ name: 'Maintenance 200'
 type: module
 description: 'Allows the maintenance page to return a Status of 200 rather than the standard 503 code.'
 core: 8.x
-configure: admin/config/development/maintenance200
\ No newline at end of file
diff --git a/maintenance200.links.menu.yml b/maintenance200.links.menu.yml
new file mode 100644
index 0000000..f4a9c43
--- /dev/null
+++ b/maintenance200.links.menu.yml
@@ -0,0 +1,5 @@
+maintenance200.settings_form:
+  title: 'Configure maintenance200'
+  route_name: maintenance200_settings
+  description: ''
+  parent: system.admin_config_development
diff --git a/maintenance200.module b/maintenance200.module
deleted file mode 100755
index c3b1f6a..0000000
--- a/maintenance200.module
+++ /dev/null
@@ -1,9 +0,0 @@
-<?php
-
-function maintenance200_menu() {
-	$items['admin/config/development/maintenance200'] = array(
-		'title' => 'Configure maintenance200',
-		'route_name' => 'maintenance200_settings',
-	);
-	return $items;
-}
\ No newline at end of file
diff --git a/maintenance200.routing.yml b/maintenance200.routing.yml
index d5c23aa..65eeef5 100644
--- a/maintenance200.routing.yml
+++ b/maintenance200.routing.yml
@@ -1,6 +1,7 @@
 maintenance200_settings:
-  pattern: 'admin/config/development/maintenance200'
+  path: '/admin/config/development/maintenance200'
   defaults:
     _form: '\Drupal\maintenance200\Form\Maintenance200SettingsForm'
+    _title: 'Maintenance200 Settings'
   requirements:
     _permission: 'administer site configuration'
\ No newline at end of file
diff --git a/maintenance200.services.yml b/maintenance200.services.yml
index a3ab556..b16c43f 100644
--- a/maintenance200.services.yml
+++ b/maintenance200.services.yml
@@ -1,5 +1,6 @@
 services:
   maintenance_mode_200_subscriber:
     class: Drupal\maintenance200\EventSubscriber\MaintenanceModeSubscriber
+    arguments: ['@maintenance_mode', '@current_user', '@config.factory']
     tags:
       - { name: event_subscriber }
\ No newline at end of file
diff --git a/src/EventSubscriber/MaintenanceModeSubscriber.php b/src/EventSubscriber/MaintenanceModeSubscriber.php
new file mode 100644
index 0000000..d0846db
--- /dev/null
+++ b/src/EventSubscriber/MaintenanceModeSubscriber.php
@@ -0,0 +1,77 @@
+<?php
+
+namespace Drupal\maintenance200\EventSubscriber;
+
+use Drupal\Core\Config\ConfigFactoryInterface;
+use Drupal\Core\Routing\RouteMatch;
+use Drupal\Core\Session\AccountInterface;
+use Drupal\Core\Site\MaintenanceModeInterface;
+use Symfony\Component\EventDispatcher\EventSubscriberInterface;
+use Symfony\Component\HttpKernel\KernelEvents;
+use Symfony\Component\HttpKernel\Event\FilterResponseEvent;
+
+class MaintenanceModeSubscriber implements EventSubscriberInterface {
+
+  /**
+   * The maintenance mode.
+   *
+   * @var \Drupal\Core\Site\MaintenanceMode
+   */
+  protected $maintenanceMode;
+
+  /**
+   * The current account.
+   *
+   * @var \Drupal\Core\Session\AccountInterface
+   */
+  protected $account;
+
+  /**
+   * @var \Drupal\Core\Config\ConfigFactoryInterface
+   */
+  protected $configFactory;
+
+  /**
+   * MaintenanceModeSubscriber constructor.
+   *
+   * @param \Drupal\Core\Site\MaintenanceModeInterface $maintenance_mode
+   * @param \Drupal\Core\Session\AccountInterface $account
+   */
+  public function __construct(MaintenanceModeInterface $maintenance_mode, AccountInterface $account, ConfigFactoryInterface $config_factory) {
+    $this->maintenanceMode = $maintenance_mode;
+    $this->account = $account;
+    $this->configFactory = $config_factory;
+  }
+
+  /**
+   * Return 200 status code if site is in maintenance mode.
+   *
+   * @param \Symfony\Component\HttpKernel\Event\FilterResponseEvent $event
+   */
+  public function onKernelResponse(FilterResponseEvent $event) {
+    if ($this->configFactory->get('maintenance200.settings')->get('maintenance200_enabled')) {
+      $status_code = $this->configFactory->get('maintenance200.settings')->get('maintenance200_status_code');
+      $request = $event->getRequest();
+      $response = $event->getResponse();
+      $route_match = RouteMatch::createFromRequest($request);
+      if ($this->maintenanceMode->applies($route_match)) {
+        if (is_numeric($status_code) && !$this->maintenanceMode->exempt($this->account)) {
+          // Return status code of 200 (instead of 503), if the site is in maintenance mode and the
+          // logged in user is not allowed to bypass it. By doing this, varnish will cache the maintenance
+          // page and serve it to new requests while in maintenance mode.
+          $response->setStatusCode($status_code);
+          $event->setResponse($response);
+        }
+      }
+    }
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public static function getSubscribedEvents() {
+    $events[KernelEvents::RESPONSE][] = array('onKernelResponse', 31);
+    return $events;
+  }
+
+}
diff --git a/src/Form/Maintenance200SettingsForm.php b/src/Form/Maintenance200SettingsForm.php
new file mode 100644
index 0000000..5458cbd
--- /dev/null
+++ b/src/Form/Maintenance200SettingsForm.php
@@ -0,0 +1,136 @@
+<?php
+
+namespace Drupal\maintenance200\Form;
+
+use Drupal\Core\Form\ConfigFormBase;
+use Drupal\Core\Form\FormStateInterface;
+
+class Maintenance200SettingsForm extends ConfigFormBase {
+
+  /**
+   * {@inheritdoc}
+   */
+  protected function getEditableConfigNames() {
+    return [
+      'maintenance200.settings',
+    ];
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function getFormId() {
+    return 'maintenance200_settings';
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function buildForm(array $form, FormStateInterface $form_state) {
+    $form = parent::buildForm($form, $form_state);
+    $config = $this->config('maintenance200.settings');
+    $form['explanation'] = array(
+      '#type' => 'markup',
+      '#markup' => 'Here, you can enable or disable the maintenance200 status code change functionality, and also set the status code that will be used if the functionality is enabled.'
+    );
+    $form['maintenance200_enabled'] = array(
+      '#type' => 'checkbox',
+      '#title' => $this->t('Change the status code during maintenance mode'),
+      '#default_value' => $config->get('maintenance200_enabled'),
+    );
+    $form['maintenance200_status_code'] = array(
+      '#type' => 'textfield',
+      '#title' => $this->t('Status code to use'),
+      '#maxlength' => '3',
+      '#size' => '3',
+      '#required' => TRUE,
+      '#description' => $this->t('A valid HTTP status code is required. See the Wikipedia <a href="http://en.wikipedia.org/wiki/List_of_HTTP_status_codes">HTTP status codes</a> page for a complete list.'),
+      '#default_value' => $config->get('maintenance200_status_code'),
+    );
+    return parent::buildForm($form, $form_state);
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function validateForm(array &$form, FormStateInterface $form_state) {
+    parent::validateForm($form, $form_state);
+    if ($form_state->getValue('maintenance200_status_code')) {
+      $http_status_codes = array(
+        100 => 'Continue',
+        101 => 'Switching Protocols',
+        102 => 'Processing',
+        200 => 'OK',
+        201 => 'Created',
+        202 => 'Accepted',
+        203 => 'Non-Authoritative Information',
+        204 => 'No Content',
+        205 => 'Reset Content',
+        206 => 'Partial Content',
+        207 => 'Multi-Status',
+        300 => 'Multiple Choices',
+        301 => 'Moved Permanently',
+        302 => 'Found',
+        303 => 'See Other',
+        304 => 'Not Modified',
+        305 => 'Use Proxy',
+        306 => 'Switch Proxy',
+        307 => 'Temporary Redirect',
+        400 => 'Bad Request',
+        401 => 'Unauthorized',
+        402 => 'Payment Required',
+        403 => 'Forbidden',
+        404 => 'Not Found',
+        405 => 'Method Not Allowed',
+        406 => 'Not Acceptable',
+        407 => 'Proxy Authentication Required',
+        408 => 'Request Timeout',
+        409 => 'Conflict',
+        410 => 'Gone',
+        411 => 'Length Required',
+        412 => 'Precondition Failed',
+        413 => 'Request Entity Too Large',
+        414 => 'Request-URI Too Long',
+        415 => 'Unsupported Media Type',
+        416 => 'Requested Range Not Satisfiable',
+        417 => 'Expectation Failed',
+        418 => 'I\'m a teapot',
+        422 => 'Unprocessable Entity',
+        423 => 'Locked',
+        424 => 'Failed Dependency',
+        425 => 'Unordered Collection',
+        426 => 'Upgrade Required',
+        449 => 'Retry With',
+        450 => 'Blocked by Windows Parental Controls',
+        500 => 'Internal Server Error',
+        501 => 'Not Implemented',
+        502 => 'Bad Gateway',
+        503 => 'Service Unavailable',
+        504 => 'Gateway Timeout',
+        505 => 'HTTP Version Not Supported',
+        506 => 'Variant Also Negotiates',
+        507 => 'Insufficient Storage',
+        509 => 'Bandwidth Limit Exceeded',
+        510 => 'Not Extended'
+      );
+      if (!array_key_exists($form_state->getValue('maintenance200_status_code'), $http_status_codes)) {
+        $form_state->setError($form['maintenance200_status_code'], $this->t('A valid HTTP status code is required.'));
+      }
+    } else {
+      $form_state->setError($form['maintenance200_status_code'], $this->t('You must provide an HTTP status code.'));
+    }
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function submitForm(array &$form, FormStateInterface $form_state) {
+    parent::submitForm($form, $form_state);
+    $this->config('maintenance200.settings')
+      ->set('maintenance200_enabled', $form_state->getValue('maintenance200_enabled'))
+      ->set('maintenance200_status_code', $form_state->getValue('maintenance200_status_code'))
+      ->save();
+    parent::submitForm($form, $form_state);
+  }
+  
+}
