diff --git a/replicate.drush.inc b/replicate.drush.inc
index beab570..81baee0 100644
--- a/replicate.drush.inc
+++ b/replicate.drush.inc
@@ -1,5 +1,12 @@
 <?php
 
+/**
+ * @file
+ */
+
+use Drupal\Core\Hook\Attribute\LegacyHook;
+use Drupal\replicate\Hook\ReplicateDrushHooks;
+
 /**
  * @file
  * Replicate entities via drush framework.
@@ -8,34 +15,17 @@
 /**
  * Implements hook_drush_command().
  */
+#[LegacyHook]
 function replicate_drush_command() {
-  $items = [];
-
-  $items['replicate-drush-entity-by-ids'] = [
-    'description' => 'Replicate an entity',
-    'arguments' => [
-      'entity-type' => dt('Type of entity (eg. Node, Comment, ...) that you wish to replicate.'),
-      'entity-ids' => dt('A comma delimited list of entity IDs which should be replicated (eg. NodeID, TermID, ...).'),
-    ],
-    'required-arguments' => 1,
-    'aliases' => ['rep', 'replicate'],
-    'examples' => [
-      'drush replicate-drush-entity-by-ids node 1' => 'Replicate node 1 using full command.',
-      'drush replicate node 1,2,3' => 'Replicate nodes 1,2 and 3 using aliased command.',
-    ],
-  ];
-
-  return $items;
+  return \Drupal::service(ReplicateDrushHooks::class)->drushCommand();
 }
 
 /**
  * Implements hook_drush_help().
  */
+#[LegacyHook]
 function replicate_drush_help($command) {
-  switch ($command) {
-    case 'drush:replicate-drush-entity-by-id':
-      return dt('Replicate an entity by providing an entity type and id.');
-  }
+  return \Drupal::service(ReplicateDrushHooks::class)->drushHelp($command);
 }
 
 /**
diff --git a/replicate.module b/replicate.module
index 735ce3d..b43edf1 100644
--- a/replicate.module
+++ b/replicate.module
@@ -5,15 +5,14 @@
  * Main methods of Replicate module.
  */
 
+use Drupal\Core\Hook\Attribute\LegacyHook;
+use Drupal\replicate\Hook\ReplicateHooks;
 use Drupal\Core\Routing\RouteMatchInterface;
 
 /**
  * Implements hook_help().
  */
+#[LegacyHook]
 function replicate_help($route_name, RouteMatchInterface $route_match) {
-  switch ($route_name) {
-    case 'help.page.replicate':
-      // Return a line-break version of the module README.md.
-      return check_markup(file_get_contents(__DIR__ . "/README.md"));
-  }
+  return \Drupal::service(ReplicateHooks::class)->help($route_name, $route_match);
 }
diff --git a/replicate.services.yml b/replicate.services.yml
index 4da8090..a821855 100644
--- a/replicate.services.yml
+++ b/replicate.services.yml
@@ -11,3 +11,11 @@ services:
     arguments: ['@entity_type.manager', '@uuid', '@replicate.replicator' ]
     tags:
       - { name: event_subscriber }
+
+  Drupal\replicate\Hook\ReplicateDrushHooks:
+    class: Drupal\replicate\Hook\ReplicateDrushHooks
+    autowire: true
+
+  Drupal\replicate\Hook\ReplicateHooks:
+    class: Drupal\replicate\Hook\ReplicateHooks
+    autowire: true
diff --git a/src/Hook/ReplicateDrushHooks.php b/src/Hook/ReplicateDrushHooks.php
new file mode 100644
index 0000000..88d5e71
--- /dev/null
+++ b/src/Hook/ReplicateDrushHooks.php
@@ -0,0 +1,52 @@
+<?php
+
+namespace Drupal\replicate\Hook;
+
+use Drupal\Core\Hook\Attribute\Hook;
+
+/**
+ * Hook implementations for replicate.
+ */
+class ReplicateDrushHooks {
+  /**
+   * @file
+   * Replicate entities via drush framework.
+   */
+
+  /**
+   * Implements hook_drush_command().
+   */
+  #[Hook('drush_command')]
+  public static function drushCommand() {
+    $items = [];
+    $items['replicate-drush-entity-by-ids'] = [
+      'description' => 'Replicate an entity',
+      'arguments' => [
+        'entity-type' => dt('Type of entity (eg. Node, Comment, ...) that you wish to replicate.'),
+        'entity-ids' => dt('A comma delimited list of entity IDs which should be replicated (eg. NodeID, TermID, ...).'),
+      ],
+      'required-arguments' => 1,
+      'aliases' => [
+        'rep',
+        'replicate',
+      ],
+      'examples' => [
+        'drush replicate-drush-entity-by-ids node 1' => 'Replicate node 1 using full command.',
+        'drush replicate node 1,2,3' => 'Replicate nodes 1,2 and 3 using aliased command.',
+      ],
+    ];
+    return $items;
+  }
+
+  /**
+   * Implements hook_drush_help().
+   */
+  #[Hook('drush_help')]
+  public static function drushHelp($command) {
+    switch ($command) {
+      case 'drush:replicate-drush-entity-by-id':
+        return dt('Replicate an entity by providing an entity type and id.');
+    }
+  }
+
+}
diff --git a/src/Hook/ReplicateHooks.php b/src/Hook/ReplicateHooks.php
new file mode 100644
index 0000000..f4e5a02
--- /dev/null
+++ b/src/Hook/ReplicateHooks.php
@@ -0,0 +1,28 @@
+<?php
+
+namespace Drupal\replicate\Hook;
+
+use Drupal\Core\Routing\RouteMatchInterface;
+use Drupal\Core\Hook\Attribute\Hook;
+
+/**
+ * Hook implementations for replicate.
+ */
+class ReplicateHooks {
+
+  /**
+   * Implements hook_help().
+   */
+  #[Hook('help')]
+  public static function help($route_name, RouteMatchInterface $route_match) {
+    switch ($route_name) {
+      case 'help.page.replicate':
+        // Return a line-break version of the module README.md.
+        return [
+          '#type' => 'processed_text',
+          '#text' => file_get_contents(__DIR__ . "/README.md"),
+        ];
+    }
+  }
+
+}
