diff --git a/guardian.api.php b/guardian.api.php
index 22966c9..c9a273b 100644
--- a/guardian.api.php
+++ b/guardian.api.php
@@ -6,7 +6,7 @@
  */
 
 /**
- * Alter the Guardian mail metadata, that will be append to the body text.
+ * Alter the Guardian mail metadata, that will be appended to the body text.
  *
  * @param string[] $body
  *   Content of mail body.
diff --git a/guardian.install b/guardian.install
index 6c685ba..fb086ee 100644
--- a/guardian.install
+++ b/guardian.install
@@ -2,7 +2,7 @@
 
 /**
  * @file
- * Install and update functions.
+ * Install, update and uninstall functions.
  */
 
 use Drupal\Core\Site\Settings;
@@ -33,7 +33,7 @@ function guardian_requirements($phase) {
     $requirements['guardian'] = [
       'title' => t('Guardian'),
       'value' => \Drupal::translation()
-        ->formatPlural($timeout_count, 'Timeout: @count hour', 'Timout: @count hours', [
+        ->formatPlural($timeout_count, 'Timeout: @count hour', 'Timeout: @count hours', [
           '@count' => $timeout_count,
         ]),
       'description' => t('Set with mail address %mail', ['%mail' => $guardian_mail]),
diff --git a/guardian.module b/guardian.module
index cc457ee..555d1fa 100644
--- a/guardian.module
+++ b/guardian.module
@@ -22,7 +22,7 @@ function guardian_help($route_name, RouteMatchInterface $route_match) {
     case 'help.page.guardian':
       $output = '';
       $output .= '<h3>' . t('About') . '</h3>';
-      $output .= '<p>' . t('This module requires that Guareded Users need to log in with <code>drush uli</code> or a password reset token url.') . '</p>';
+      $output .= '<p>' . t('This module requires that Guarded Users need to log in with <code>drush uli</code> or a password reset token url.') . '</p>';
       return $output;
   }
 
@@ -47,7 +47,6 @@ function guardian_cron() {
       $account->save();
     }
   }
-
 }
 
 /**
@@ -65,13 +64,14 @@ function guardian_mail($key, &$message, $params) {
 /**
  * Implements hook_ENTITY_TYPE_access().
  *
- * Only guarded accounts can do view, update or delete guarded accounts.
+ * Only guarded accounts can view, update or delete guarded accounts.
  * Uid 1 can only be viewed or updated by uid 1.
  */
 function guardian_user_access(EntityInterface $entity, $operation, AccountInterface $account) {
   /** @var \Drupal\guardian\GuardianManagerInterface $guardian */
   $guardian = \Drupal::service('guardian.manager');
 
+  /** @var \Drupal\user\UserInterface $entity */
   if (!$guardian->isGuarded($entity)) {
     return AccessResult::neutral();
   }
@@ -122,6 +122,7 @@ function guardian_user_presave(EntityInterface $entity) {
   /** @var \Drupal\guardian\GuardianManagerInterface $guardian */
   $guardian = \Drupal::service('guardian.manager');
 
+  /** @var \Drupal\user\UserInterface $entity */
   if ($guardian->isGuarded($entity)) {
     $guardian->setDefaultUserValues($entity);
   }
diff --git a/guardian.services.yml b/guardian.services.yml
index 13a924a..2daefe1 100644
--- a/guardian.services.yml
+++ b/guardian.services.yml
@@ -1,8 +1,19 @@
 services:
   guardian.manager:
-    class: '\Drupal\guardian\GuardianManager'
+    class: Drupal\guardian\GuardianManager
+    arguments:
+    - '@config.factory'
+    - '@entity_type.manager'
+    - '@plugin.manager.mail'
+    - '@request_stack'
+    - '@current_user'
+    - '@session_manager'
+    - '@datetime.time'
+    - '@email.validator'
+    - '@module_handler'
+
   guardian.event_subscriber:
-    class: '\Drupal\guardian\EventSubscriber\GuardianSubscriber'
+    class: Drupal\guardian\EventSubscriber\GuardianSubscriber
     arguments: ['@guardian.manager', '@current_user']
     tags:
       - {name: 'event_subscriber'}
diff --git a/src/GuardianManager.php b/src/GuardianManager.php
index f615c13..4ce98f4 100644
--- a/src/GuardianManager.php
+++ b/src/GuardianManager.php
@@ -2,11 +2,19 @@
 
 namespace Drupal\guardian;
 
+use Drupal\Component\Datetime\TimeInterface;
+use Drupal\Core\Config\ConfigFactoryInterface;
+use Drupal\Core\Entity\EntityTypeManagerInterface;
+use Drupal\Core\Extension\ModuleHandlerInterface;
 use Drupal\Core\Logger\LoggerChannelTrait;
+use Drupal\Core\Mail\MailManagerInterface;
 use Drupal\Core\Session\AccountInterface;
+use Drupal\Core\Session\SessionManagerInterface;
 use Drupal\Core\Site\Settings;
 use Drupal\Core\StringTranslation\StringTranslationTrait;
 use Drupal\user\UserInterface;
+use Egulias\EmailValidator\EmailValidator;
+use Symfony\Component\HttpFoundation\RequestStack;
 
 /**
  * Class GuardianManager.
@@ -18,10 +26,107 @@ final class GuardianManager implements GuardianManagerInterface {
   use StringTranslationTrait, LoggerChannelTrait;
 
   /**
+   * The configuration object factory service.
+   *
+   * @var \Drupal\Core\Config\ConfigFactoryInterface
+   */
+  protected $configFactory;
+
+  /**
+   * The entity type manager service.
+   *
+   * @var \Drupal\Core\Entity\EntityTypeManagerInterface
+   */
+  protected $entityTypeManager;
+
+  /**
+   * The mail manager service.
+   *
+   * @var \Drupal\Core\Mail\MailManagerInterface
+   */
+  protected $mailManager;
+
+  /**
+   * The request stack.
+   *
+   * @var \Symfony\Component\HttpFoundation\RequestStack
+   */
+  protected $requestStack;
+
+  /**
+   * The account object.
+   *
+   * @var \Drupal\Core\Session\AccountInterface
+   */
+  protected $currentUser;
+
+  /**
+   * The session manager.
+   *
+   * @var \Drupal\Core\Session\SessionManagerInterface
+   */
+  protected $sessionManager;
+
+  /**
+   * The time service.
+   *
+   * @var \Drupal\Component\Datetime\TimeInterface
+   */
+  protected $time;
+
+  /**
+   * The email validator.
+   *
+   * @var \Egulias\EmailValidator\EmailValidator
+   */
+  protected $emailValidator;
+
+  /**
+   * The module handler service.
+   *
+   * @var \Drupal\Core\Extension\ModuleHandlerInterface
+   */
+  protected $moduleHandler;
+
+  /**
+   * GuardianManager constructor.
+   *
+   * @param \Drupal\Core\Config\ConfigFactoryInterface $config_factory
+   *   The configuration object factory service.
+   * @param \Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager
+   *   The entity type manager service.
+   * @param \Drupal\Core\Mail\MailManagerInterface $mail_manager
+   *   The mail manager service.
+   * @param \Symfony\Component\HttpFoundation\RequestStack $request_stack
+   *   The request stack.
+   * @param \Drupal\Core\Session\AccountInterface $current_user
+   *   The account object.
+   * @param \Drupal\Core\Session\SessionManagerInterface $session_manager
+   *   The session manager.
+   * @param \Drupal\Component\Datetime\TimeInterface $time
+   *   The time service.
+   * @param \Egulias\EmailValidator\EmailValidator $email_validator
+   *   The email validator.
+   * @param \Drupal\Core\Extension\ModuleHandlerInterface $module_handler
+   *   The module handler service.
+   */
+  public function __construct(ConfigFactoryInterface $config_factory, EntityTypeManagerInterface $entity_type_manager, MailManagerInterface $mail_manager, RequestStack $request_stack, AccountInterface $current_user, SessionManagerInterface $session_manager, TimeInterface $time, EmailValidator $email_validator, ModuleHandlerInterface $module_handler) {
+    $this->configFactory = $config_factory;
+    $this->entityTypeManager = $entity_type_manager;
+    $this->mailManager = $mail_manager;
+    $this->requestStack = $request_stack;
+    $this->currentUser = $current_user;
+    $this->sessionManager = $session_manager;
+    $this->time = $time;
+    $this->emailValidator = $email_validator;
+    $this->moduleHandler = $module_handler;
+  }
+
+  /**
    * {@inheritdoc}
    */
   public function notifyModuleState($isEnabled) {
-    $site = \Drupal::config('system.site')->get('name');
+    $site = $this->configFactory->getEditable('system.site')->get('name');
 
     if ($isEnabled) {
       $subject = $this->t('Guardian has been enabled for @site', [
@@ -44,11 +149,10 @@ final class GuardianManager implements GuardianManagerInterface {
     ];
 
     $guardian_mail = Settings::get('guardian_mail');
-    $user = \Drupal::entityTypeManager()->getStorage('user')->load(1);
+    /** @var \Drupal\user\UserInterface $user */
+    $user = $this->entityTypeManager->getStorage('user')->load(1);
 
-    /** @var \Drupal\Core\Mail\MailManagerInterface $mailManager */
-    $mailManager = \Drupal::service('plugin.manager.mail');
-    $mailManager->mail('guardian', 'notification', $guardian_mail, $user->getPreferredLangcode(), $params, NULL, TRUE);
+    $this->mailManager->mail('guardian', 'notification', $guardian_mail, $user->getPreferredLangcode(), $params, NULL, TRUE);
   }
 
   /**
@@ -70,28 +174,27 @@ final class GuardianManager implements GuardianManagerInterface {
    */
   public function addMetadataToBody(array &$body) {
     $body[] = $this->t('Client IP: @ip', [
-      '@ip' => \Drupal::request()->getClientIp(),
+      '@ip' => $this->requestStack->getCurrentRequest()->getClientIp(),
     ]);
     $body[] = $this->t('Host name: @host', [
-      '@host' => \Drupal::request()->getHost(),
+      '@host' => $this->requestStack->getCurrentRequest()->getHost(),
     ]);
 
     if (PHP_SAPI === 'cli') {
       $body[] = $this->t('Terminal user: @user', ['@user' => $_SERVER['USER'] ?: $this->t('Unknown')]);
     }
 
-    \Drupal::moduleHandler()->alter('guardian_add_metadata_to_body', $body);
+    $this->moduleHandler->alter('guardian_add_metadata_to_body', $body);
   }
 
   /**
    * {@inheritdoc}
    */
   public function destroySession(AccountInterface $account) {
-    $current_user = \Drupal::currentUser();
 
-    \Drupal::service('session_manager')->delete($account->id());
+    $this->sessionManager->delete($account->id());
 
-    if ($account->id() == $current_user->id()) {
+    if ($account->id() == $this->currentUser->id()) {
       user_logout();
     }
   }
@@ -112,7 +215,7 @@ final class GuardianManager implements GuardianManagerInterface {
    */
   public function hasValidData(AccountInterface $account) {
     /** @var \Drupal\user\UserInterface $user */
-    $user = \Drupal::entityTypeManager()
+    $user = $this->entityTypeManager
       ->getStorage('user')
       ->load($account->id());
 
@@ -142,7 +245,7 @@ final class GuardianManager implements GuardianManagerInterface {
    */
   public function hasValidSession(AccountInterface $account) {
     $guardian_seconds = 3600 * Settings::get('guardian_hours', 2);
-    $timeout = \Drupal::time()->getRequestTime() - $guardian_seconds;
+    $timeout = $this->time->getRequestTime() - $guardian_seconds;
     return $account->getLastAccessedTime() > $timeout;
   }
 
@@ -173,15 +276,13 @@ final class GuardianManager implements GuardianManagerInterface {
     static $users = [];
 
     if (empty($users)) {
-      $mail_validator = \Drupal::service('email.validator');
-      $implementations = \Drupal::moduleHandler()
-        ->getImplementations('guardian_guarded_users');
+      $implementations = $this->moduleHandler->getImplementations('guardian_guarded_users');
 
       foreach ($implementations as $module) {
         $function = $module . '_guardian_guarded_users';
         $guarded_users = $function();
         foreach ($guarded_users as $uid => $mail) {
-          if (empty($mail) || !is_int($uid) || $uid < 2 || !$mail_validator->isValid($mail)) {
+          if (empty($mail) || !is_int($uid) || $uid < 2 || !$this->emailValidator->isValid($mail)) {
             unset($guarded_users[$uid]);
           }
         }
