diff --git a/css/style.css b/css/style.css
index d1ce044..0b7b97d 100644
--- a/css/style.css
+++ b/css/style.css
@@ -1,34 +1,34 @@
 .node-by-term-form {
-    display: flex;
-    display: flex;
-    flex-wrap: wrap;
-    margin-block: var(--space-l);
-    padding: var(--space-xs) var(--space-l) var(--space-l) var(--space-l);
-    border: var(--details-border-size) solid var(--details-border-color);
-    border-radius: var(--details-border-size-radius);
-    background-color: var(--color-white);
-    box-shadow: var(--details-box-shadow);
-    padding-top: 20px;
+  display: flex;
+  display: flex;
+  flex-wrap: wrap;
+  margin-block: var(--space-l);
+  padding: var(--space-xs) var(--space-l) var(--space-l) var(--space-l);
+  border: var(--details-border-size) solid var(--details-border-color);
+  border-radius: var(--details-border-size-radius);
+  background-color: var(--color-white);
+  box-shadow: var(--details-box-shadow);
+  padding-top: 20px;
 }
-.form-item--term{
-    width:124px;
+.form-item--term {
+  width: 124px;
 }
 .form-item {
-    max-width: 100%;
-    margin-block: var(--space-s) 0;
-    margin-inline: 0 var(--space-xs);
-    margin-top: 0 !important;
-    margin-bottom: 0 !important;
+  max-width: 100%;
+  margin-block: var(--space-s) 0;
+  margin-inline: 0 var(--space-xs);
+  margin-top: 0 !important;
+  margin-bottom: 0 !important;
 }
-.form-item--vocabulary{
-    width: 286px;
+.form-item--vocabulary {
+  width: 286px;
 }
-.button{
-    margin-top: 25px !important;
-    margin-left: 12px !important;
+.button {
+  margin-top: 25px !important;
+  margin-left: 12px !important;
 }
 .btn:hover {
-    color: var(--bs-btn-hover-color) !important;
-    background-color: var(--bs-btn-hover-bg) !important;
-    border-color: var(--bs-btn-hover-border-color) !important;
-}
\ No newline at end of file
+  color: var(--bs-btn-hover-color) !important;
+  background-color: var(--bs-btn-hover-bg) !important;
+  border-color: var(--bs-btn-hover-border-color) !important;
+}
diff --git a/node_by_term.info.yml b/node_by_term.info.yml
index 2284b52..5151d34 100644
--- a/node_by_term.info.yml
+++ b/node_by_term.info.yml
@@ -4,5 +4,5 @@ description: 'Fetch nodes by vocabulary, term, and content type.'
 package: Node By Term
 core_version_requirement: ^9 || ^10
 dependencies:
-  - node
-  - taxonomy
\ No newline at end of file
+  - drupal:node
+  - drupal:taxonomy
diff --git a/node_by_term.install b/node_by_term.install
index 8248fb0..1e89988 100644
--- a/node_by_term.install
+++ b/node_by_term.install
@@ -5,15 +5,18 @@
  * Install, update and uninstall functions for the mymodule module.
  */
 
+use Drupal\Core\Link;
+use Drupal\Core\Url;
+
 /**
  * Implements hook_install().
  */
 function node_by_term_install() {
   // Define the URL.
-  $url = \Drupal\Core\Url::fromUri('internal:/node-list');
+  $url = Url::fromUri('internal:/node-list');
 
   // Create the link.
-  $link = \Drupal\Core\Link::fromTextAndUrl(t('Go to the node list'), $url)->toString();
+  $link = Link::fromTextAndUrl(t('Go to the node list'), $url)->toString();
 
   // Display a message.
   \Drupal::messenger()->addStatus(t('The module has been installed. You can now go to the @link.', ['@link' => $link]));
diff --git a/node_by_term.module b/node_by_term.module
index a68ec20..b216c1d 100644
--- a/node_by_term.module
+++ b/node_by_term.module
@@ -1,16 +1,22 @@
 <?php
-use Drupal\Core\Form\FormStateInterface;
+
+/**
+ * @file
+ * Implements Node By Term module.
+ */
+
 /**
  * Implements hook_form_FORM_ID_alter().
  */
 function node_by_term_form_node_form_alter(&$form, $form_state, $form_id) {
-    // Add a custom submit handler to the form.
+  // Add a custom submit handler to the form.
   $form['actions']['submit']['#submit'][] = 'node_by_term_node_form_submit';
 }
+
 /**
  * Custom submit handler for the node form.
  */
 function node_by_term_node_form_submit($form, $form_state) {
-    // Set a redirect to the node list page after the form is submitted.
+  // Set a redirect to the node list page after the form is submitted.
   $form_state->setRedirect('node_by_term.nodelist');
 }
diff --git a/node_by_term.routing.yml b/node_by_term.routing.yml
index 0f44692..c0b36c9 100644
--- a/node_by_term.routing.yml
+++ b/node_by_term.routing.yml
@@ -13,4 +13,5 @@ node_by_term.nodelist:
     _title: 'Node-list'
   requirements:
     _permission: 'access content'
-    _access: 'TRUE' 
\ No newline at end of file
+    # Please add comment manually here.
+    _access: 'TRUE'
diff --git a/src/Controller/NodeListController.php b/src/Controller/NodeListController.php
index 1f33354..8cd0ef2 100644
--- a/src/Controller/NodeListController.php
+++ b/src/Controller/NodeListController.php
@@ -3,124 +3,191 @@
 namespace Drupal\node_by_term\Controller;
 
 use Drupal\Core\Controller\ControllerBase;
-use Drupal\node_by_term\Form\NodeByTermForm;
-use Drupal\Core\Database\Connection;
-use Symfony\Component\DependencyInjection\ContainerInterface;
 use Drupal\Core\Url;
 use Drupal\Component\Render\FormattableMarkup;
 use Drupal\Core\Link;
-use Drupal\Core\Pager\PagerManagerInterface;
-use Symfony\Component\HttpFoundation\Request;
-use Drupal\node\Entity\Node; 
+use Drupal\Core\Entity\EntityTypeManagerInterface;
+use Drupal\Core\Datetime\DateFormatterInterface;
+use Drupal\Core\Database\Connection;
+use Drupal\Core\Form\FormBuilderInterface;
+use Drupal\taxonomy\VocabularyStorageInterface;
+use Symfony\Component\DependencyInjection\ContainerInterface;
 
 /**
- * NodeListController.
+ * Filter Node by Vocabulary and terms.
  */
-
 class NodeListController extends ControllerBase {
+
+  /**
+   * The entity type manager.
+   *
+   * @var \Drupal\Core\Entity\EntityTypeManagerInterface
+   */
+  protected $entityTypeManager;
+
+  /**
+   * The date formatter service.
+   *
+   * @var \Drupal\Core\Datetime\DateFormatterInterface
+   */
+  protected $dateFormatter;
+
+  /**
+   * The database connection.
+   *
+   * @var \Drupal\Core\Database\Connection
+   */
+  protected $database;
+
+  /**
+   * The form builder.
+   *
+   * @var \Drupal\Core\Form\FormBuilderInterface
+   */
+  protected $formBuilder;
+
+  /**
+   * Vocabulary storage.
+   *
+   * @var \Drupal\taxonomy\VocabularyStorageInterface
+   */
+  protected $vocabularyStorage;
+
+  /**
+   * Constructs a new EntityActionDeriverBase object.
+   *
+   * @param \Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager
+   *   The entity type manager.
+   * @param \Drupal\Core\Datetime\DateFormatterInterface $date_formatter
+   *   The date formatter service.
+   * @param \Drupal\Core\Database\Connection $database
+   *   The database connection.
+   * @param \Drupal\Core\Form\FormBuilderInterface $form_builder
+   *   The form builder.
+   * @param \Drupal\taxonomy\VocabularyStorageInterface $vocabulary_storage
+   *   Vocabulary storage.
+   */
+  public function __construct(EntityTypeManagerInterface $entity_type_manager, DateFormatterInterface $date_formatter, Connection $database, FormBuilderInterface $form_builder, VocabularyStorageInterface $vocabulary_storage) {
+    $this->entityTypeManager = $entity_type_manager;
+    $this->dateFormatter = $date_formatter;
+    $this->database = $database;
+    $this->formBuilder = $form_builder;
+    $this->vocabularyStorage = $vocabulary_storage;
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public static function create(ContainerInterface $container) {
+    return new static(
+      $container->get('entity_type.manager'),
+      $container->get('date.formatter'),
+      $container->get('database'),
+      $container->get('form_builder'),
+      $container->get('node_by_term.vocabulary_storage')
+    );
+  }
+
   /**
    * {@inheritdoc}
    */
   public function nodelist() {
-    $data['filter'] = \Drupal::formBuilder()->getForm('Drupal\node_by_term\Form\NodeByTermForm');
-    $vocab = \Drupal::request()->query->get('vocab');
-    $t_id = \Drupal::request()->query->get('t_id');
-    $content_type = \Drupal::request()->query->get('cont_type');
-          
+    $data['filter'] = $this->formBuilder->getForm('Drupal\node_by_term\Form\NodeByTermForm');
+    $vocab = $this->getRequest()->query->get('vocab');
+    $t_id = $this->getRequest()->query->get('t_id');
+    $content_type = $this->getRequest()->query->get('cont_type');
+
     // Load the vocabulary by its machine name.
-    if(!empty($vocab)){
-      $vocabulary = \Drupal\taxonomy\Entity\Vocabulary::load($vocab);
+    if (!empty($vocab)) {
+      $vocabulary = $this->vocabularyStorage->load($vocab);
       $vocabulary_id = $vocabulary->id();
-      $term_ids = \Drupal::entityQuery('taxonomy_term')
-          ->condition('vid', $vocabulary_id)
-          ->accessCheck(FALSE)  // This line is added.
-          ->execute();
+      $term_ids = $this->entityTypeManager->getStorage('taxonomy_term')->getQuery()
+        ->condition('vid', $vocabulary_id)
+      // This line is added.
+        ->accessCheck(FALSE)
+        ->execute();
     }
 
-    if(!empty($vocab) AND  empty($t_id) AND empty($content_type)) {
-        $query = \Drupal::database()->select('taxonomy_index', 'ti');
-        $query->join('node_field_data', 'nfd', 'nfd.nid = ti.nid');
-        $query->fields('nfd', ['created', 'changed']);
-        $query->fields('ti', ['nid']);
-        $query->condition('ti.tid', $term_ids, 'IN');
-          
-        //For the pagination we need to extend the pagerselectextender and
-        $pager = $query->extend('Drupal\Core\Database\Query\PagerSelectExtender')->limit(2);
-        $nids = $pager->execute()->fetchall();
-        
-        $nid = [];
-        foreach($nids as $ids) {
-          $nid[] = $ids->nid;
-        }
-        $nodes = Node::loadMultiple($nid);
+    if (!empty($vocab) and  empty($t_id) and empty($content_type)) {
+      $query = $this->database->select('taxonomy_index', 'ti');
+      $query->join('node_field_data', 'nfd', 'nfd.nid = ti.nid');
+      $query->fields('nfd', ['created', 'changed']);
+      $query->fields('ti', ['nid']);
+      $query->condition('ti.tid', $term_ids, 'IN');
+
+      // For the pagination we need to extend the pagerselectextender and.
+      $pager = $query->extend('Drupal\Core\Database\Query\PagerSelectExtender')->limit(2);
+      $nids = $pager->execute()->fetchall();
+
+      $nid = [];
+      foreach ($nids as $ids) {
+        $nid[] = $ids->nid;
+      }
+      $nodes = $this->entityTypeManager()->getStorage('node')->loadMultiple($nid);
     }
-    elseif(!empty($vocab AND $t_id)) {
-      $query = \Drupal::database()->select('taxonomy_index', 'ti');
+    elseif (!empty($vocab and $t_id)) {
+      $query = $this->database->select('taxonomy_index', 'ti');
       $query->join('node_field_data', 'nfd', 'nfd.nid = ti.nid');
       $query->fields('nfd', ['created', 'changed']);
       $query->fields('ti', ['nid']);
       $query->condition('ti.tid', $t_id);
       // Add the condition on the content type, if content type is set.
-        if (isset($content_type) && !empty($content_type)) {
-          $query->condition('nfd.type', $content_type);
-        }
-      //For the pagination we need to extend the pagerselectextender and
+      if (isset($content_type) && !empty($content_type)) {
+        $query->condition('nfd.type', $content_type);
+      }
+      // For the pagination we need to extend the pagerselectextender and.
       $pager = $query->extend('Drupal\Core\Database\Query\PagerSelectExtender')->limit(2);
       $nids = $pager->execute()->fetchall();
       $nid = [];
-      foreach($nids as $ids) {
+      foreach ($nids as $ids) {
         $nid[] = $ids->nid;
       }
-      $nodes = Node::loadMultiple($nid);
-    } 
-    else{
-      $query = \Drupal::database()->select('node_field_data', 'nfd');
+      $nodes = $this->entityTypeManager()->getStorage('node')->loadMultiple($nid);
+    }
+    else {
+      $query = $this->database->select('node_field_data', 'nfd');
       $query->fields('nfd', ['nid']);
       $query->addField('nfd', 'created');
       $query->addField('nfd', 'changed');
-      if(isset($content_type) && !empty($content_type))
-      {
+      if (isset($content_type) && !empty($content_type)) {
         $query->condition('nfd.type', $content_type);
       }
-      $pager = $query->extend('Drupal\Core\Database\Query\PagerSelectExtender')->limit(2);       
-      $nids = $pager->execute()->fetchCol();                          
+      $pager = $query->extend('Drupal\Core\Database\Query\PagerSelectExtender')->limit(2);
+      $nids = $pager->execute()->fetchCol();
       $nid = [];
-      foreach($nids as $ids) {
+      foreach ($nids as $ids) {
         $nid[] = $ids;
       }
-      $nodes = Node::loadMultiple($nid);
+      $nodes = $this->entityTypeManager()->getStorage('node')->loadMultiple($nid);
     }
 
-  
-    // $nodes = Node::loadMultiple($nid);
-
     // Prepare the header for the table.
     $header = [
       'title' => $this->t('Node Title'),
       'content_type' => $this->t('Content Type'),
       'status' => $this->t('Published Status'),
-      'created-date'=> $this->t('Created date'),
-      'last modified date'=> $this->t('Last modified'),
+      'created-date' => $this->t('Created date'),
+      'last modified date' => $this->t('Last modified'),
       'Operations' => $this->t('Operations'),
     ];
     // Prepare the rows for the table.
     $rows = [];
 
-    foreach ($nodes as $node) 
-    {
+    foreach ($nodes as $node) {
       // Format dates.
-      $created_date = \Drupal::service('date.formatter')->format($node->getCreatedTime(), 'custom', 'd-m-Y H:i:s');
-      $changed_date = \Drupal::service('date.formatter')->format($node->getChangedTime(), 'custom', 'd-m-Y H:i:s');
-     
-      
+      $created_date = $this->dateFormatter->format($node->getCreatedTime(), 'custom', 'd-m-Y H:i:s');
+      $changed_date = $this->dateFormatter->format($node->getChangedTime(), 'custom', 'd-m-Y H:i:s');
+
       $edit_url = Url::fromRoute('entity.node.edit_form', ['node' => $node->id()])->toString();
-      $edit_link = new FormattableMarkup('<a href=":link">:label</a>', [':link' => $edit_url, ':label' => $this->t('Edit')]);
+      $edit_link = new FormattableMarkup('<a href=":link">:label</a>',
+      [':link' => $edit_url, ':label' => $this->t('Edit')]);
       // Create "View" link.
       $view_url = Url::fromRoute('entity.node.canonical', ['node' => $node->id()]);
       $view_link = Link::fromTextAndUrl($this->t('View'), $view_url)->toString();
       // Render the links.
-      $links = new FormattableMarkup('@edit_link | @view_link', ['@edit_link' => $edit_link, '@view_link' => $view_link]);
-     
+      $links = new FormattableMarkup('@edit_link | @view_link',
+      ['@edit_link' => $edit_link, '@view_link' => $view_link]);
+
       $rows[] = [
         'title' => $node->getTitle(),
         'content_type' => $node->getType(),
@@ -139,11 +206,12 @@ class NodeListController extends ControllerBase {
       '#empty' => $this->t('No nodes founds.'),
     ];
     $data['pager'] = [
-      '#type' => 'pager'
+      '#type' => 'pager',
     ];
     // Prevent caching.
     $data['#cache']['max-age'] = 0;
 
     return $data;
   }
-}
\ No newline at end of file
+
+}
diff --git a/src/Form/NodeByTermForm.php b/src/Form/NodeByTermForm.php
index 84db908..6cfc25b 100644
--- a/src/Form/NodeByTermForm.php
+++ b/src/Form/NodeByTermForm.php
@@ -2,16 +2,55 @@
 
 namespace Drupal\node_by_term\Form;
 
+use Drupal\Core\Url;
 use Drupal\Core\Form\FormBase;
 use Drupal\Core\Form\FormStateInterface;
-use Drupal\taxonomy\Entity\Vocabulary;
-use Drupal\taxonomy\Entity\Term;
+use Drupal\Core\Entity\EntityTypeManagerInterface;
+use Drupal\taxonomy\VocabularyStorageInterface;
+use Symfony\Component\DependencyInjection\ContainerInterface;
 
 /**
  * Provides a form to filter nodes.
  */
 class NodeByTermForm extends FormBase {
 
+  /**
+   * The entity type manager.
+   *
+   * @var \Drupal\Core\Entity\EntityTypeManagerInterface
+   */
+  protected $entityTypeManager;
+
+  /**
+   * Vocabulary storage.
+   *
+   * @var \Drupal\taxonomy\VocabularyStorageInterface
+   */
+  protected $vocabularyStorage;
+
+  /**
+   * Constructs a new EntityActionDeriverBase object.
+   *
+   * @param \Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager
+   *   The entity type manager.
+   * @param \Drupal\taxonomy\VocabularyStorageInterface $vocabulary_storage
+   *   Vocabulary storage.
+   */
+  public function __construct(EntityTypeManagerInterface $entity_type_manager, VocabularyStorageInterface $vocabulary_storage) {
+    $this->entityTypeManager = $entity_type_manager;
+    $this->vocabularyStorage = $vocabulary_storage;
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public static function create(ContainerInterface $container) {
+    return new static(
+      $container->get('entity_type.manager'),
+      $container->get('node_by_term.vocabulary_storage')
+    );
+  }
+
   /**
    * {@inheritdoc}
    */
@@ -23,14 +62,13 @@ class NodeByTermForm extends FormBase {
    * {@inheritdoc}
    */
   public function buildForm(array $form, FormStateInterface $form_state) {
-    //get elements from query parameter 
-
-    $vocab = \Drupal::request()->query->get('vocab');
-    $t_id = \Drupal::request()->query->get('t_id');
-    $content_type_value = \Drupal::request()->query->get('cont_type');
-    
-    //this will load all vocabulary
-    $vocabularies = Vocabulary::loadMultiple();
+    // Get elements from query parameter.
+    $vocab = $this->getRequest()->query->get('vocab');
+    $t_id = $this->getRequest()->query->get('t_id');
+    $content_type_value = $this->getRequest()->query->get('cont_type');
+
+    // This will load all vocabulary.
+    $vocabularies = $this->vocabularyStorage->load();
     $options = ['-select-'];
     foreach ($vocabularies as $vocabulary) {
       $options[$vocabulary->id()] = $vocabulary->label();
@@ -40,23 +78,22 @@ class NodeByTermForm extends FormBase {
       '#type' => 'select',
       '#title' => $this->t('Vocabulary'),
       '#options' => $options,
-      '#default_value'=> !empty($vocab) ? $vocab : '', 
+      '#default_value' => !empty($vocab) ? $vocab : '',
       '#ajax' => [
-        'callback' => '::load_term',
+        'callback' => '::loadTerm',
         'event' => 'change',
         'wrapper' => 'term-wrapper',
-      ], 
+      ],
       '#attributes' => [
         'class' => ['form-control'],
-      ],     
+      ],
     ];
 
     // If vocabulary is selected, load its terms.
     $selected_vocabulary = $form_state->getValue('vocabulary');
 
     if (!empty($selected_vocabulary)) {
-      $terms = \Drupal::entityTypeManager()
-        ->getStorage('taxonomy_term')
+      $terms = $this->entityTypeManager->getStorage('taxonomy_term')
         ->loadTree($selected_vocabulary);
       $term_options = ['-select-'];
       foreach ($terms as $term) {
@@ -64,10 +101,9 @@ class NodeByTermForm extends FormBase {
       }
     }
     else {
-      // this condition will apply after submitting
-      $terms = \Drupal::entityTypeManager()
-      ->getStorage('taxonomy_term')
-      ->loadTree($vocab);
+      // This condition will apply after submitting.
+      $terms = $this->entityTypeManager->getStorage('taxonomy_term')
+        ->loadTree($vocab);
 
       $term_options = ['-select-'];
       foreach ($terms as $term) {
@@ -81,16 +117,16 @@ class NodeByTermForm extends FormBase {
       '#prefix' => '<div id="term-wrapper"  >',
       '#suffix' => '</div>',
       '#options' => !empty($term_options) ? $term_options : ['No term'] ,
-      '#default_value' =>!empty($t_id) ? $t_id :  ' ',
+      '#default_value' => !empty($t_id) ? $t_id : ' ',
       '#attributes' => [
         'class' => ['form-control'],
       ],
     ];
 
     // Fetch all content types.
-    $content_types = \Drupal::service('entity_type.manager')->getStorage('node_type')->loadMultiple();
+    $content_types = $this->entityTypeManager->getStorage('node_type')->loadMultiple();
     $content_type_options = ['-select-'];
-    
+
     foreach ($content_types as $content_type) {
       $content_type_options[$content_type->id()] = $content_type->label();
     }
@@ -110,40 +146,47 @@ class NodeByTermForm extends FormBase {
       '#value' => $this->t('Submit'),
       '#attributes' => [
         'class' => ['btn btn-success'],
-      ],      
+      ],
     ];
-   
-    $form['actions']['reset'] = array(
+
+    $form['actions']['reset'] = [
       '#type' => 'submit',
       '#value' => $this->t('Reset'),
-      '#submit' => array('::resetForm'),
+      '#submit' => ['::resetForm'],
       '#attributes' => [
         'class' => ['btn btn-danger'],
       ],
-    );
+    ];
     $form['#attached']['library'][] = 'node_by_term/my_styles';
 
-
     return $form;
   }
 
   /**
    * {@inheritdoc}
    */
-  public function load_term(array $form, FormStateInterface $form_state) {
+  public function loadTerm(array $form, FormStateInterface $form_state) {
     return $form['term'];
   }
-  public function resetForm(array &$form, FormStateInterface $form_state) {
-  $form_state->setRedirect('node_by_term.nodelist'); 
-}
 
+  /**
+   * {@inheritdoc}
+   */
+  public function resetForm(array &$form, FormStateInterface $form_state) {
+    $form_state->setRedirect('node_by_term.nodelist');
+  }
 
+  /**
+   * {@inheritdoc}
+   */
   public function submitForm(array &$form, FormStateInterface $form_state) {
-    $vocab = $form_state->getValue('vocabulary');  
-    $t_id = $form_state->getValue('term');   
+    $vocab = $form_state->getValue('vocabulary');
+    $t_id = $form_state->getValue('term');
     $cont_type = $form_state->getValue('content_type');
-    
-    $url = \Drupal\Core\Url::fromRoute('node_by_term.nodelist')->setRouteParameters(['vocab' => $vocab, 't_id' => $t_id , 'cont_type' => $cont_type]);
-    $form_state->setRedirectUrl($url);   
+
+    $url = Url::fromRoute('node_by_term.nodelist')->setRouteParameters(
+      ['vocab' => $vocab, 't_id' => $t_id, 'cont_type' => $cont_type]);
+    $form_state->setRedirectUrl($url);
   }
-}
\ No newline at end of file
+
+}
