diff --git a/lib/Drupal/navigation404/Controller/Navigation404Controller.php b/lib/Drupal/navigation404/Controller/Navigation404Controller.php
new file mode 100644
index 0000000..be34fa4
--- /dev/null
+++ b/lib/Drupal/navigation404/Controller/Navigation404Controller.php
@@ -0,0 +1,22 @@
+<?php
+/**
+ * @file
+ * Contains \Drupal\navigation404\Controller\Navigation404Controller.
+ */
+
+namespace Drupal\navigation404\Controller;
+use Drupal\Core\Controller\ControllerBase;
+
+/**
+ * Provides route responses for navigation404.module.
+ */
+class Navigation404Controller extends ControllerBase {
+  /**
+   * Returns "Not found" text.
+   */
+  public function notFound() {
+    return array(
+      '#markup' => $this->t('The requested page could not be found.')
+    );
+  }
+}
\ No newline at end of file
diff --git a/navigation404.info b/navigation404.info
deleted file mode 100644
index e9af862..0000000
--- a/navigation404.info
+++ /dev/null
@@ -1,4 +0,0 @@
-name = "404 Navigation"
-description = "On a 404 page, ensure navigation links are displayed properly."
-
-core = 7.x
diff --git a/navigation404.info.yml b/navigation404.info.yml
new file mode 100644
index 0000000..72d5a44
--- /dev/null
+++ b/navigation404.info.yml
@@ -0,0 +1,4 @@
+name: 404 Navigation
+description: On a 404 page, ensure navigation links are displayed properly.
+type: module
+core: 8.x
diff --git a/navigation404.install b/navigation404.install
index e8f43e6..ccff846 100644
--- a/navigation404.install
+++ b/navigation404.install
@@ -1,20 +1,24 @@
 <?php
 /**
- * Implements hook_enable().
+ * @file install file.
+ */
+
+/**
+ * Implements hook_install().
  *
  * If site_404 is not set, all menu-related items disappear on 404.
  */
-function navigation404_enable() {
-  if (variable_get('site_404', '') == '') {
-    variable_set('site_404', NAVIGATION404_PAGE);
+function navigation404_install() {
+  if (!Drupal::config('system.site')->get('page.404')) {
+    Drupal::config('system.site')->set('page.404', NAVIGATION404_PAGE)->save();
   }
 }
 
 /**
- * Implements hook_disable().
+ * Implements hook_uninstall().
  */
-function navigation404_disable() {
-  if (variable_get('site_404', '') == NAVIGATION404_PAGE) {
-    variable_del('site_404');
+function navigation404_uninstall() {
+  if (Drupal::config('system.site')->get('page.404') == NAVIGATION404_PAGE) {
+    Drupal::config('system.site')->delete('page.404');
   }
 }
diff --git a/navigation404.module b/navigation404.module
index 8da3ab8..22c702d 100644
--- a/navigation404.module
+++ b/navigation404.module
@@ -1,26 +1,9 @@
 <?php
-define('NAVIGATION404_PAGE', 'navigation404');
-
 /**
- * Implements hook_menu().
+ * @file main module file.
  */
-function navigation404_menu() {
-  $items[NAVIGATION404_PAGE] = array(
-    'title'           => 'Page not found',
-    'access callback' => TRUE,
-    'page callback'   => 'navigation404_404_page',
-    'type'            => MENU_CALLBACK,
-  );
-  return $items;
-}
 
-/**
- * Our custom menu callback that returns Drupal's standard 404 message.
- */
-function navigation404_404_page() {
-  drupal_set_title(t('Page not found'));
-  return t('The requested page could not be found.');
-}
+define('NAVIGATION404_PAGE', 'navigation404');
 
 /**
  * Implements hook_form_alter().
diff --git a/navigation404.routing.yml b/navigation404.routing.yml
new file mode 100644
index 0000000..50d7b8d
--- /dev/null
+++ b/navigation404.routing.yml
@@ -0,0 +1,7 @@
+navigation404.content:
+  path: navigation404
+  defaults:
+    _content: '\Drupal\navigation404\Controller\Navigation404Controller::notFound'
+    _title: 'Page not found'
+  requirements: 
+    _access: 'TRUE'
\ No newline at end of file
