diff --git a/modules/single_page_site_next_page/src/EventSubscriber/AlterSinglePageSiteOutput.php b/modules/single_page_site_next_page/src/EventSubscriber/AlterSinglePageSiteOutput.php
index dc2592e..cf343a2 100644
--- a/modules/single_page_site_next_page/src/EventSubscriber/AlterSinglePageSiteOutput.php
+++ b/modules/single_page_site_next_page/src/EventSubscriber/AlterSinglePageSiteOutput.php
@@ -10,7 +10,7 @@ use Drupal\single_page_site\Manager\SinglePageSiteManager;
 use Symfony\Component\EventDispatcher\EventSubscriberInterface;
 
 /**
- * Class AlterSinglePageSiteOutput.
+ * Provides functionality for altering single page site output.
  *
  * @package Drupal\single_page_site_newt_page\EventSubscriber
  */
diff --git a/single_page_site.module b/single_page_site.module
index 3a548b4..6bc81a5 100644
--- a/single_page_site.module
+++ b/single_page_site.module
@@ -5,9 +5,9 @@
  * Module hooks file for Single Page Site.
  */
 
+use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Routing\RouteMatchInterface;
 use Drupal\Core\Url;
-use Drupal\Core\Form\FormStateInterface;
 
 /**
  * Implements hook_help().
diff --git a/src/Controller/SinglePageSiteController.php b/src/Controller/SinglePageSiteController.php
index 11706e0..df6f36d 100644
--- a/src/Controller/SinglePageSiteController.php
+++ b/src/Controller/SinglePageSiteController.php
@@ -2,19 +2,19 @@
 
 namespace Drupal\single_page_site\Controller;
 
-use Drupal\single_page_site\Event\EventSinglePageSiteAlterOutput;
-use Drupal\single_page_site\Event\SinglePageSiteEvents;
-use Symfony\Component\DependencyInjection\ContainerInterface;
 use Drupal\Core\Controller\ControllerBase;
 use Drupal\Core\Extension\ModuleHandler;
 use Drupal\Core\Link;
 use Drupal\Core\Render\RendererInterface;
 use Drupal\Core\Url;
+use Drupal\single_page_site\Event\EventSinglePageSiteAlterOutput;
+use Drupal\single_page_site\Event\SinglePageSiteEvents;
 use Drupal\single_page_site\Manager\SinglePageSiteManager;
+use Symfony\Component\DependencyInjection\ContainerInterface;
 use Symfony\Component\EventDispatcher\EventDispatcherInterface;
 
 /**
- * Class SinglePageSiteController.
+ * Class to providing functionality for SinglePageSiteController.
  *
  * @package Drupal\single_page_site\Controller
  */
@@ -93,7 +93,7 @@ class SinglePageSiteController extends ControllerBase {
    *   Return the array with render.
    */
   public function render() {
-    if ($menu = $this->manager->getMenu()) {
+    if ($this->manager->getMenu()) {
       $items = [];
       $current_item_count = 1;
       // Collect all drupal messages and store them, we will show them later on.
@@ -175,7 +175,7 @@ class SinglePageSiteController extends ControllerBase {
       // If settings aren't set.
       return [
         '#markup' => $this->t('You have to !configure your single page before you can use it.',
-          ['!configure' => Link::fromTextAndUrl(t('configure'), Url::fromRoute('single_page_site.config'))]),
+          ['!configure' => Link::fromTextAndUrl($this->t('configure'), Url::fromRoute('single_page_site.config'))]),
       ];
     }
   }
diff --git a/src/Event/EventSinglePageSiteAlterOutput.php b/src/Event/EventSinglePageSiteAlterOutput.php
index 0e81ac2..79798be 100644
--- a/src/Event/EventSinglePageSiteAlterOutput.php
+++ b/src/Event/EventSinglePageSiteAlterOutput.php
@@ -5,7 +5,7 @@ namespace Drupal\single_page_site\Event;
 use Symfony\Component\EventDispatcher\Event;
 
 /**
- * Class EventSinglePageSiteAlterOutput.
+ * Class to providing functionality for EventSinglePageSiteAlterOutput.
  *
  * @package Drupal\single_page_site\Event
  */
diff --git a/src/Event/SinglePageSiteEvents.php b/src/Event/SinglePageSiteEvents.php
index d09cb63..0f7c780 100644
--- a/src/Event/SinglePageSiteEvents.php
+++ b/src/Event/SinglePageSiteEvents.php
@@ -3,7 +3,7 @@
 namespace Drupal\single_page_site\Event;
 
 /**
- * Class SinglePageSiteEvents.
+ * Class to providing functionality for SinglePageSiteEvents.
  *
  * @package Drupal\single_page_site\Event
  */
diff --git a/src/Form/SinglePageSiteConfigForm.php b/src/Form/SinglePageSiteConfigForm.php
index edc37da..b15d295 100644
--- a/src/Form/SinglePageSiteConfigForm.php
+++ b/src/Form/SinglePageSiteConfigForm.php
@@ -3,13 +3,14 @@
 namespace Drupal\single_page_site\Form;
 
 use Drupal\Core\Config\ConfigFactoryInterface;
+use Drupal\Core\Entity\Query\QueryFactoryInterface;
 use Drupal\Core\Extension\ModuleHandlerInterface;
-use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Form\ConfigFormBase;
+use Drupal\Core\Form\FormStateInterface;
 use Symfony\Component\DependencyInjection\ContainerInterface;
 
 /**
- * Class SinglePageSiteConfigForm.
+ * Class to providing functionality for SinglePageSiteConfigForm.
  *
  * @package Drupal\single_page_site\Form
  */
@@ -22,17 +23,27 @@ class SinglePageSiteConfigForm extends ConfigFormBase {
    */
   protected $moduleHandler;
 
+  /**
+   * The entity query service.
+   *
+   * @var \Drupal\Core\Entity\Query\QueryFactoryInterface
+   */
+  protected $entityQueryFactory;
+
   /**
    * SinglePageSiteConfigForm constructor.
    *
    * @param \Drupal\Core\Config\ConfigFactoryInterface $config_factory
    *   Config factory to load/save config.
    * @param \Drupal\Core\Extension\ModuleHandlerInterface $module_handler
-   *   Core module handler.
+   *   The module handler.
+   * @param \Drupal\Core\Entity\Query\QueryFactoryInterface $entityQueryFactory
+   *   The Entity Query Factory.
    */
-  public function __construct(ConfigFactoryInterface $config_factory, ModuleHandlerInterface $module_handler) {
+  public function __construct(ConfigFactoryInterface $config_factory, ModuleHandlerInterface $module_handler, QueryFactoryInterface $entityQueryFactory) {
     parent::__construct($config_factory);
     $this->moduleHandler = $module_handler;
+    $this->entityQueryFactory = $entityQueryFactory;
   }
 
   /**
@@ -68,25 +79,25 @@ class SinglePageSiteConfigForm extends ConfigFormBase {
 
     $form['general-settings'] = [
       '#type' => 'details',
-      '#title' => t('General settings'),
+      '#title' => $this->t('General settings'),
       '#open' => TRUE,
     ];
 
     $form['general-settings']['menu'] = [
-      '#title' => t('Menu'),
+      '#title' => $this->t('Menu'),
       '#type' => 'select',
       '#options' => $menus,
       '#default_value' => !empty($settings->get('menu')) ? $settings->get('menu') : NULL,
       '#required' => TRUE,
-      '#description' => t('Which menu should be used for the single page navigation?'),
+      '#description' => $this->t('Which menu should be used for the single page navigation?'),
     ];
 
     $form['general-settings']['menuclass'] = [
-      '#title' => t('Menu Class/Id'),
+      '#title' => $this->t('Menu Class/Id'),
       '#type' => 'textfield',
       '#default_value' => !empty($settings->get('menuclass')) ? $settings->get('menuclass') : NULL,
       '#required' => TRUE,
-      '#description' => t('Define the class/id of the menu wrapper. Eg: #main-menu or .main-menu'),
+      '#description' => $this->t('Define the class/id of the menu wrapper. Eg: #main-menu or .main-menu'),
     ];
 
     $description = $this->t('You need to install the "link attributes module" to use this feature');
@@ -95,7 +106,7 @@ class SinglePageSiteConfigForm extends ConfigFormBase {
     }
 
     $form['general-settings']['class'] = [
-      '#title' => t('Menu item selector'),
+      '#title' => $this->t('Menu item selector'),
       '#type' => 'textfield',
       '#default_value' => !empty($settings->get('class')) ? $settings->get('class') : NULL,
       '#required' => FALSE,
@@ -104,82 +115,82 @@ class SinglePageSiteConfigForm extends ConfigFormBase {
     ];
 
     $form['general-settings']['title'] = [
-      '#title' => t('Title'),
+      '#title' => $this->t('Title'),
       '#type' => 'textfield',
       '#default_value' => !empty($settings->get('title')) ? $settings->get('title') : NULL,
       '#required' => TRUE,
-      '#description' => t('Configure the title of the page'),
+      '#description' => $this->t('Configure the title of the page'),
     ];
 
     $form['general-settings']['tag'] = [
-      '#title' => t('Tag'),
+      '#title' => $this->t('Tag'),
       '#type' => 'textfield',
       '#default_value' => !empty($settings->get('tag')) ? $settings->get('tag') : NULL,
       '#required' => TRUE,
-      '#description' => t('Define the HTML tag which should be used for title-wrapping. Eg: h2 or p'),
+      '#description' => $this->t('Define the HTML tag which should be used for title-wrapping. Eg: h2 or p'),
     ];
 
-    $description = $settings->get('homepage') ? t('Unchecking this option will not change your homepage setting. You will have to re-configure it manually.') :
-      t('I will use this page as my homepage');
+    $description = $settings->get('homepage') ? $this->t('Unchecking this option will not change your homepage setting. You will have to re-configure it manually.') :
+    $this->t('I will use this page as my homepage');
     $form['general-settings']['homepage'] = [
       '#type' => 'checkbox',
-      '#title' => t('Homepage'),
+      '#title' => $this->t('Homepage'),
       '#description' => $description,
-      '#default_value' => $settings->get('homepage') !== NULL ? $settings->get('homepage') : 1,
+      '#default_value' => $settings->get('homepage') ?? 1,
     ];
 
     $form['scroll-settings'] = [
       '#type' => 'details',
-      '#title' => t('Scroll settings'),
+      '#title' => $this->t('Scroll settings'),
       '#open' => FALSE,
     ];
 
     $form['scroll-settings']['scroll-down'] = [
-      '#title' => t('Down'),
+      '#title' => $this->t('Down'),
       '#type' => 'textfield',
       '#default_value' => !empty($settings->get('down')) ? $settings->get('down') : 50,
       '#required' => TRUE,
-      '#description' => t('Define the distance between the item and the viewport (px) when a menu item should be highlighted when scrolling down'),
+      '#description' => $this->t('Define the distance between the item and the viewport (px) when a menu item should be highlighted when scrolling down'),
     ];
 
     $form['scroll-settings']['scroll-up'] = [
-      '#title' => t('Up'),
+      '#title' => $this->t('Up'),
       '#type' => 'textfield',
       '#default_value' => !empty($settings->get('up')) ? $settings->get('up') : 200,
       '#required' => TRUE,
-      '#description' => t('Define the distance between the item and the viewport (px) when a menu item should be highlighted when scrolling up'),
+      '#description' => $this->t('Define the distance between the item and the viewport (px) when a menu item should be highlighted when scrolling up'),
     ];
 
     $form['advanced-settings'] = [
       '#type' => 'details',
-      '#title' => t('Advanced settings'),
+      '#title' => $this->t('Advanced settings'),
       '#open' => FALSE,
     ];
 
     $form['advanced-settings']['smooth-scrolling'] = [
       '#type' => 'checkbox',
-      '#title' => t('Use smooth scrolling'),
-      '#default_value' => $settings->get('smoothscrolling') !== NULL ? $settings->get('smoothscrolling') : 1,
+      '#title' => $this->t('Use smooth scrolling'),
+      '#default_value' => $settings->get('smoothscrolling') ?? 1,
     ];
 
     $form['advanced-settings']['update-hash'] = [
       '#type' => 'checkbox',
-      '#title' => t('Update url fragment while scrolling'),
+      '#title' => $this->t('Update url fragment while scrolling'),
       '#default_value' => $settings->get('updatehash') ? $settings->get('updatehash') : 0,
     ];
 
     $form['advanced-settings']['offset-selector'] = [
-      '#title' => t('Which menu should be used for calculating the offset'),
+      '#title' => $this->t('Which menu should be used for calculating the offset'),
       '#type' => 'textfield',
       '#default_value' => $settings->get('offsetselector') ? $settings->get('offsetselector') : NULL,
-      '#description' => t('The height of this selector will be used to determine the scroll to position. Most of the times this is will be the same selector as your "Menu Class/Id"'),
+      '#description' => $this->t('The height of this selector will be used to determine the scroll to position. Most of the times this is will be the same selector as your "Menu Class/Id"'),
     ];
 
     $form['advanced-settings']['filter-url-prefix'] = [
-      '#title' => t("Filter url prefixes out of anchor ID's"),
+      '#title' => $this->t("Filter url prefixes out of anchor ID's"),
       '#type' => 'checkbox',
       '#default_value' => $settings->get('filterurlprefix') ? $settings->get('filterurlprefix') : 0,
-      '#description' => t('This removes the language prefix out of the anchor ID. Enable this option if the menu does not work for multilingual pages.'),
+      '#description' => $this->t('This removes the language prefix out of the anchor ID. Enable this option if the menu does not work for multilingual pages.'),
     ];
 
     return parent::buildForm($form, $form_state);
@@ -195,20 +206,20 @@ class SinglePageSiteConfigForm extends ConfigFormBase {
     $menu_class = $form_state->getValue('menuclass');
     if (preg_match('/[^A-Za-z0-9#.-]/', $menu_class)) {
       $form_state->setErrorByName('menuclass',
-        t('"Menu Class/Id" contains forbidden chars. Only a-z, #, ., - allowed.'));
+      $this->t('"Menu Class/Id" contains forbidden chars. Only a-z, #, ., - allowed.'));
     }
 
     // Validate class on non alphapetic chars.
     $class = $form_state->getValue('class');
     if (preg_match('/[^A-Za-z0-9-]/', $class)) {
       $form_state->setErrorByName('class',
-        t('"Menu item selector"  contains forbidden chars. Only a-z, - allowed.'));
+      $this->t('"Menu item selector"  contains forbidden chars. Only a-z, - allowed.'));
     }
 
     // Validate tag on special chars.
     $tag = $form_state->getValue('tag');
     if (preg_match('/[^A-Za-z0-9]/', $tag)) {
-      $form_state->setErrorByName('tag', t('"Tag" contains special characters.'));
+      $form_state->setErrorByName('tag', $this->t('"Tag" contains special characters.'));
     }
   }
 
@@ -238,7 +249,7 @@ class SinglePageSiteConfigForm extends ConfigFormBase {
         ->save();
     }
 
-    $this->messenger()->addMessage(t('Your settings have been saved.'));
+    $this->messenger()->addMessage($this->t('Your settings have been saved.'));
   }
 
   /**
@@ -248,7 +259,7 @@ class SinglePageSiteConfigForm extends ConfigFormBase {
    *   Return Menus.
    */
   private function getMenus() {
-    return \Drupal::entityQuery('menu')->execute();
+    return $this->entityQueryFactory('menu')->execute();
   }
 
 }
diff --git a/src/Manager/SinglePageSiteManager.php b/src/Manager/SinglePageSiteManager.php
index f1bbad0..9e756dc 100644
--- a/src/Manager/SinglePageSiteManager.php
+++ b/src/Manager/SinglePageSiteManager.php
@@ -21,7 +21,7 @@ use Symfony\Component\HttpKernel\HttpKernelInterface;
 use Symfony\Component\HttpKernel\KernelEvents;
 
 /**
- * Class SinglePageSiteManager.
+ * Class to providing functionality for SinglePageSiteManager.
  *
  * @package Drupal\single_page_site\Manager
  */
