diff --git a/config2php.module b/config2php.module
index c84475a..c45b065 100644
--- a/config2php.module
+++ b/config2php.module
@@ -4,7 +4,8 @@
  * @file
  * Exports configuration elements as a ready-to-use PHP associative array.
  */
-
+use Drupal\Core\Hook\Attribute\LegacyHook;
+use Drupal\config2php\Hook\Config2phpHooks;
 use Drupal\config2php\Form\Config2PhpSettingsForm;
 use Drupal\Core\Cache\RefinableCacheableDependencyInterface;
 use Drupal\Core\Link;
@@ -14,56 +15,28 @@ use Drupal\Core\Url;
 /**
  * Implements hook_help().
  */
-function config2php_help($route_name, RouteMatchInterface $route_match) {
-  $output = '';
-
-  switch ($route_name) {
-    case 'help.page.config2php':
-      $output .= '<h3>' . t('About') . '</h3><p>';
-
-      $link = Link::createFromRoute(t('configuration export functionality'), 'config.export_single');
-
-      $output .= t(
-        "Simplifies the extraction of configuration elements and their conversion into a PHP associative array. While Drupal's core provides @url, it outputs data in YAML format, requiring additional conversion steps before it can be used in PHP code.",
-        ['@url' => $link->toString()]
-      );
-
-      $output .= '</p><p>' . t('Provides a user-friendly interface for selecting the configuration type and specific element, generating a properly formatted PHP array that is immediately ready for use. It ensures correct syntax formatting, including proper array key wrapping, colon-to-arrow replacement, trailing commas, and other necessary adjustments.') . '</p>';
-      break;
-
-    case 'config2php.export':
-      $output .= '<p>' . t('Choose a configuration item to display its PHP array structure.') . '</p>';
-      break;
-
-    case Config2PhpSettingsForm::NAME:
-      $output .= '<p>' . t('Configure which keys of the exported configuration should be hidden and whether to open the export page of the module with the same name instead of the similar page provided by Drupal core.') . '</p>';
-      break;
-  }
-
-  return $output;
+#[LegacyHook]
+function config2php_help($route_name, RouteMatchInterface $route_match)
+{
+    return \Drupal::service(Config2phpHooks::class)->help($route_name, $route_match);
 }
 
 /**
  * Implements hook_menu_links_discovered_alter().
  */
+#[LegacyHook]
 function config2php_menu_links_discovered_alter(&$links) {
-  if (\Drupal::config(Config2PhpSettingsForm::NAME)->get('override')) {
-    $links['admin_toolbar_tools.extra_links:config.export']['route_name'] = 'config2php.export';
-  }
+  \Drupal::service(Config2phpHooks::class)->menuLinksDiscoveredAlter($links);
 }
 
 /**
  * Implements hook_menu_local_tasks_alter().
  */
+#[LegacyHook]
 function config2php_menu_local_tasks_alter(
   &$data,
   $route_name,
   RefinableCacheableDependencyInterface &$cacheability
 ) {
-  if (
-    isset($data['tabs'][0]['config.export']) &&
-    \Drupal::config(Config2PhpSettingsForm::NAME)->get('override')
-  ) {
-    $data['tabs'][0]['config.export']['#link']['url'] = Url::fromRoute('config2php.export');
-  }
+  \Drupal::service(Config2phpHooks::class)->menuLocalTasksAlter($data, $route_name, $cacheability);
 }
diff --git a/config2php.services.yml b/config2php.services.yml
index c8c7bce..53141c2 100644
--- a/config2php.services.yml
+++ b/config2php.services.yml
@@ -6,3 +6,7 @@ services:
     class: Drupal\config2php\Routing\Config2PhpRouteSubscriber
     tags:
       - { name: event_subscriber }
+
+  Drupal\config2php\Hook\Config2phpHooks:
+    class: Drupal\config2php\Hook\Config2phpHooks
+    autowire: true
diff --git a/src/Hook/Config2phpHooks.php b/src/Hook/Config2phpHooks.php
new file mode 100644
index 0000000..bdcd6dd
--- /dev/null
+++ b/src/Hook/Config2phpHooks.php
@@ -0,0 +1,63 @@
+<?php
+
+namespace Drupal\config2php\Hook;
+
+use Drupal\config2php\Form\Config2PhpSettingsForm;
+use Drupal\Core\Cache\RefinableCacheableDependencyInterface;
+use Drupal\Core\Link;
+use Drupal\Core\Routing\RouteMatchInterface;
+use Drupal\Core\Url;
+use Drupal\Core\Hook\Attribute\Hook;
+use Drupal\Core\StringTranslation\StringTranslationTrait;
+/**
+ * Hook implementations for config2php.
+ */
+class Config2phpHooks
+{
+    use StringTranslationTrait;
+    /**
+     * Implements hook_help().
+     */
+    #[Hook('help')]
+    public function help($route_name, \Drupal\Core\Routing\RouteMatchInterface $route_match)
+    {
+        $output = '';
+        switch ($route_name) {
+            case 'help.page.config2php':
+                $output .= '<h3>' . $this->t('About') . '</h3><p>';
+                $link = \Drupal\Core\Link::createFromRoute($this->t('configuration export functionality'), 'config.export_single');
+                $output .= $this->t("Simplifies the extraction of configuration elements and their conversion into a PHP associative array. While Drupal's core provides @url, it outputs data in YAML format, requiring additional conversion steps before it can be used in PHP code.", [
+                    '@url' => $link->toString(),
+                ]);
+                $output .= '</p><p>' . $this->t('Provides a user-friendly interface for selecting the configuration type and specific element, generating a properly formatted PHP array that is immediately ready for use. It ensures correct syntax formatting, including proper array key wrapping, colon-to-arrow replacement, trailing commas, and other necessary adjustments.') . '</p>';
+                break;
+            case 'config2php.export':
+                $output .= '<p>' . $this->t('Choose a configuration item to display its PHP array structure.') . '</p>';
+                break;
+            case \Drupal\config2php\Form\Config2PhpSettingsForm::NAME:
+                $output .= '<p>' . $this->t('Configure which keys of the exported configuration should be hidden and whether to open the export page of the module with the same name instead of the similar page provided by Drupal core.') . '</p>';
+                break;
+        }
+        return $output;
+    }
+    /**
+     * Implements hook_menu_links_discovered_alter().
+     */
+    #[Hook('menu_links_discovered_alter')]
+    public static function menuLinksDiscoveredAlter(&$links)
+    {
+        if (\Drupal::config(\Drupal\config2php\Form\Config2PhpSettingsForm::NAME)->get('override')) {
+            $links['admin_toolbar_tools.extra_links:config.export']['route_name'] = 'config2php.export';
+        }
+    }
+    /**
+     * Implements hook_menu_local_tasks_alter().
+     */
+    #[Hook('menu_local_tasks_alter')]
+    public static function menuLocalTasksAlter(&$data, $route_name, \Drupal\Core\Cache\RefinableCacheableDependencyInterface &$cacheability)
+    {
+        if (isset($data['tabs'][0]['config.export']) && \Drupal::config(\Drupal\config2php\Form\Config2PhpSettingsForm::NAME)->get('override')) {
+            $data['tabs'][0]['config.export']['#link']['url'] = \Drupal\Core\Url::fromRoute('config2php.export');
+        }
+    }
+}
