diff --git a/html_script_formatter.module b/html_script_formatter.module
index b480efb..870e5b5 100644
--- a/html_script_formatter.module
+++ b/html_script_formatter.module
@@ -4,34 +4,22 @@
  * @file
  * Contains html_script_formatter.module.
  */
-
+use Drupal\Core\Hook\Attribute\LegacyHook;
+use Drupal\html_script_formatter\Hook\HtmlScriptFormatterHooks;
 use Drupal\Core\Routing\RouteMatchInterface;
 
 /**
  * Implements hook_help().
  */
+#[LegacyHook]
 function html_script_formatter_help($route_name, RouteMatchInterface $route_match) {
-  switch ($route_name) {
-    // Main module help for the html_script_formatter module.
-    case 'help.page.html_script_formatter':
-      $output = '';
-      $output .= '<h3>' . t('About') . '</h3>';
-      $output .= '<p>' . t('All text field type support HTML Formatter') . '</p>';
-      return $output;
-
-    default:
-  }
+  return \Drupal::service(HtmlScriptFormatterHooks::class)->help($route_name, $route_match);
 }
 
 /**
  * Implements hook_theme().
  */
+#[LegacyHook]
 function html_script_formatter_theme() {
-  return [
-    'html_script_formatter' => [
-      'variables' => [
-        'content' => NULL
-      ],
-    ],
-  ];
+  return \Drupal::service(HtmlScriptFormatterHooks::class)->theme();
 }
diff --git a/html_script_formatter.services.yml b/html_script_formatter.services.yml
new file mode 100644
index 0000000..7553013
--- /dev/null
+++ b/html_script_formatter.services.yml
@@ -0,0 +1,5 @@
+
+services:
+  Drupal\html_script_formatter\Hook\HtmlScriptFormatterHooks:
+    class: Drupal\html_script_formatter\Hook\HtmlScriptFormatterHooks
+    autowire: true
diff --git a/src/Hook/HtmlScriptFormatterHooks.php b/src/Hook/HtmlScriptFormatterHooks.php
new file mode 100644
index 0000000..251eebf
--- /dev/null
+++ b/src/Hook/HtmlScriptFormatterHooks.php
@@ -0,0 +1,44 @@
+<?php
+
+namespace Drupal\html_script_formatter\Hook;
+
+use Drupal\Core\Routing\RouteMatchInterface;
+use Drupal\Core\Hook\Attribute\Hook;
+use Drupal\Core\StringTranslation\StringTranslationTrait;
+/**
+ * Hook implementations for html_script_formatter.
+ */
+class HtmlScriptFormatterHooks
+{
+    use StringTranslationTrait;
+    /**
+     * Implements hook_help().
+     */
+    #[Hook('help')]
+    public function help($route_name, \Drupal\Core\Routing\RouteMatchInterface $route_match)
+    {
+        switch ($route_name) {
+            // Main module help for the html_script_formatter module.
+            case 'help.page.html_script_formatter':
+                $output = '';
+                $output .= '<h3>' . $this->t('About') . '</h3>';
+                $output .= '<p>' . $this->t('All text field type support HTML Formatter') . '</p>';
+                return $output;
+            default:
+        }
+    }
+    /**
+     * Implements hook_theme().
+     */
+    #[Hook('theme')]
+    public function theme()
+    {
+        return [
+            'html_script_formatter' => [
+                'variables' => [
+                    'content' => NULL,
+                ],
+            ],
+        ];
+    }
+}
