diff --git a/src/Form/FlagResetForm.php b/src/Form/FlagResetForm.php
index d8677d2..65fafff 100644
--- a/src/Form/FlagResetForm.php
+++ b/src/Form/FlagResetForm.php
@@ -7,16 +7,24 @@
 namespace Drupal\flag\Form;
 
 use Drupal\Core\Url;
-use Drupal\flag\FlagInterface;
 use Drupal\Core\Form\ConfirmFormBase;
 use Drupal\Core\Form\FormStateInterface;
-
+use Drupal\flag\FlagInterface;
+use Drupal\flag\FlagService;
+use Symfony\Component\DependencyInjection\ContainerInterface;
 /**
  * Provides the flag reset form.
  */
 class FlagResetForm extends ConfirmFormBase {
 
   /**
+   * The Flag Service.
+   *
+   * @var \Drupal\flag\FlagService $flagService
+   */
+  protected $flagService;
+
+  /**
    * The flag to reset.
    *
    * @var \Drupal\flag\FlagInterface
@@ -24,6 +32,22 @@ class FlagResetForm extends ConfirmFormBase {
   protected $flag;
 
   /**
+   * Class constructor.
+   */
+  public function __construct(FlagService $flag_service) {
+    $this->flagService = $flag_service;
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public static function create(ContainerInterface $container) {
+    return new static(
+      $container->get('flag')
+    );
+  }
+
+  /**
    * {@inheritdoc}
    */
   public function buildForm(array $form, FormStateInterface $form_state,
@@ -76,7 +100,7 @@ class FlagResetForm extends ConfirmFormBase {
    * {@inheritdoc}
    */
   public function submitForm(array &$form, FormStateInterface $form_state) {
-    \Drupal::service('flag')->reset($this->flag);
+    $this->flagService->reset($this->flag);
     drupal_set_message($this->t('Flag %label was reset.', [
       '%label' => $this->flag->label(),
     ]));
