diff --git a/front_page.module b/front_page.module
index 1820476..9a8a728 100644
--- a/front_page.module
+++ b/front_page.module
@@ -11,27 +11,22 @@
  * please post them at http://drupal.org/project/issues/front.
  */
 
+use Drupal\Core\Hook\Attribute\LegacyHook;
+use Drupal\front_page\Hook\FrontPageHooks;
 use Drupal\Core\Routing\RouteMatchInterface;
 
 /**
  * Implements hook_help().
  */
+#[LegacyHook]
 function front_page_help($route_name, RouteMatchInterface $route_match) {
-  switch ($route_name) {
-    case 'front_page.settings':
-      return t('<p>Setup custom front pages for your site.</p>');
-
-    case 'help.page.front_page':
-      return t('<p>If a HOME link is set, the &lt;front&gt; placeholder will be replaced with this value instead of the standard front page.</p>');
-  }
+  return \Drupal::service(FrontPageHooks::class)->help($route_name, $route_match);
 }
 
 /**
  * Implements hook_user_role_delete().
  */
+#[LegacyHook]
 function front_page_user_role_delete($role) {
-  // Delete Front configuration for the role being deleted.
-  $config = \Drupal::configFactory()->getEditable('front_page.settings');
-  $config->clear('rid_' . $role->id());
-  $config->save();
+  \Drupal::service(FrontPageHooks::class)->userRoleDelete($role);
 }
diff --git a/front_page.services.yml b/front_page.services.yml
index d1cb73f..08b87a1 100644
--- a/front_page.services.yml
+++ b/front_page.services.yml
@@ -10,3 +10,7 @@ services:
     arguments: ['@config.factory']
     tags:
       - {name: path_processor_outbound}
+
+  Drupal\front_page\Hook\FrontPageHooks:
+    class: Drupal\front_page\Hook\FrontPageHooks
+    autowire: true
diff --git a/src/Hook/FrontPageHooks.php b/src/Hook/FrontPageHooks.php
new file mode 100644
index 0000000..bbadb0a
--- /dev/null
+++ b/src/Hook/FrontPageHooks.php
@@ -0,0 +1,40 @@
+<?php
+
+namespace Drupal\front_page\Hook;
+
+use Drupal\Core\Routing\RouteMatchInterface;
+use Drupal\Core\Hook\Attribute\Hook;
+use Drupal\Core\StringTranslation\StringTranslationTrait;
+
+/**
+ * Hook implementations for front_page.
+ */
+class FrontPageHooks {
+  use StringTranslationTrait;
+
+  /**
+   * Implements hook_help().
+   */
+  #[Hook('help')]
+  public function help($route_name, RouteMatchInterface $route_match) {
+    switch ($route_name) {
+      case 'front_page.settings':
+        return $this->t('<p>Setup custom front pages for your site.</p>');
+
+      case 'help.page.front_page':
+        return $this->t('<p>If a HOME link is set, the &lt;front&gt; placeholder will be replaced with this value instead of the standard front page.</p>');
+    }
+  }
+
+  /**
+   * Implements hook_user_role_delete().
+   */
+  #[Hook('user_role_delete')]
+  public static function userRoleDelete($role) {
+    // Delete Front configuration for the role being deleted.
+    $config = \Drupal::configFactory()->getEditable('front_page.settings');
+    $config->clear('rid_' . $role->id());
+    $config->save();
+  }
+
+}
