diff --git a/entity_copy_reference.module b/entity_copy_reference.module
index 9feb66b..7240743 100644
--- a/entity_copy_reference.module
+++ b/entity_copy_reference.module
@@ -4,7 +4,8 @@
  * @file
  * Contains entity_copy_reference.module.
  */
-
+use Drupal\Core\Hook\Attribute\LegacyHook;
+use Drupal\entity_copy_reference\Hook\EntityCopyReferenceHooks;
 use Drupal\Core\Routing\RouteMatchInterface;
 use Drupal\Core\Url;
 use Drupal\entity_copy_reference\EntityCopyReference;
@@ -13,72 +14,25 @@ use Drupal\node\Entity\Node;
 /**
  * Implements hook_help().
  */
+#[LegacyHook]
 function entity_copy_reference_help($route_name, RouteMatchInterface $route_match) {
-  switch ($route_name) {
-    // Main module help for the entity_copy_reference module.
-    case 'help.page.entity_copy_reference':
-      $output = '';
-      $output .= '<h3>' . t('About') . '</h3>';
-      $output .= '<p>' . t('Module for easy one click node copy/clone creation') . '</p>' .
-        '<p>' . t('The module allows for configuration as to what referenced entities should be copied 
-        along with parent node (such as paragraphs or related content types') . '</p>';
-      return $output;
-
-    default:
-  }
+  return \Drupal::service(EntityCopyReferenceHooks::class)->help($route_name, $route_match);
 }
 
 /**
  * Implements hook_local_tasks_alter().
  */
-function entity_copy_reference_menu_local_tasks_alter(&$data, $route_name, &$cacheability) {
-
-  // If not in edit or front end view.
-  if (
-    $route_name !== 'entity.node.edit_form'
-    && $route_name !== 'entity.node.canonical'
-  ) {
-    return;
-  }
-
-  $node = \Drupal::routeMatch()->getParameter('node');
-  $entityCopyReference = new EntityCopyReference();
-
-  if ($node->access('update') && $entityCopyReference->isCopyEnabled($node)) {
-
-    $data['tabs'][0]['entity_copy_reference.copy'] = [
-      '#theme' => 'menu_local_task',
-      '#link' => [
-        'title' => t('Copy'),
-        'url' => Url::fromRoute('entity_copy_reference.copy', [
-          'node' => $node->id(),
-        ]),
-        'localized_options' => [],
-      ],
-      '#weight' => 2,
-      '#active' => FALSE,
-      '#access' => 'use entity_copy_reference',
-    ];
-
-  }
+#[LegacyHook]
+function entity_copy_reference_menu_local_tasks_alter(&$data, $route_name, &$cacheability)
+{
+    \Drupal::service(EntityCopyReferenceHooks::class)->menuLocalTasksAlter($data, $route_name, $cacheability);
 }
 
 /**
  * Implements hook_entity_operation_alter().
  */
-function entity_copy_reference_entity_operation_alter(&$operations, $entity) {
-  if (!$entity instanceof Node) {
-    return;
-  }
-
-  $entityCopyReference = new EntityCopyReference();
-  if ($entityCopyReference->isCopyEnabled($entity) && $entity->access('update')) {
-    $weight = (array_key_exists('edit', $operations)) ? $operations['edit']['weight'] + 1 : count($operations) + 1;
-
-    $operations['entity_copy_reference.copy'] = [
-      'title' => t('Copy'),
-      'url' => Url::fromRoute('entity_copy_reference.copy', ['node' => $entity->id()]),
-      'weight' => $weight,
-    ];
-  }
+#[LegacyHook]
+function entity_copy_reference_entity_operation_alter(&$operations, $entity)
+{
+    \Drupal::service(EntityCopyReferenceHooks::class)->entityOperationAlter($operations, $entity);
 }
diff --git a/entity_copy_reference.services.yml b/entity_copy_reference.services.yml
new file mode 100644
index 0000000..0fba02e
--- /dev/null
+++ b/entity_copy_reference.services.yml
@@ -0,0 +1,5 @@
+
+services:
+  Drupal\entity_copy_reference\Hook\EntityCopyReferenceHooks:
+    class: Drupal\entity_copy_reference\Hook\EntityCopyReferenceHooks
+    autowire: true
diff --git a/src/Hook/EntityCopyReferenceHooks.php b/src/Hook/EntityCopyReferenceHooks.php
new file mode 100644
index 0000000..1d65093
--- /dev/null
+++ b/src/Hook/EntityCopyReferenceHooks.php
@@ -0,0 +1,84 @@
+<?php
+
+namespace Drupal\entity_copy_reference\Hook;
+
+use Drupal\Core\Routing\RouteMatchInterface;
+use Drupal\Core\Url;
+use Drupal\entity_copy_reference\EntityCopyReference;
+use Drupal\node\Entity\Node;
+use Drupal\Core\Hook\Attribute\Hook;
+use Drupal\Core\StringTranslation\StringTranslationTrait;
+/**
+ * Hook implementations for entity_copy_reference.
+ */
+class EntityCopyReferenceHooks
+{
+    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 entity_copy_reference module.
+            case 'help.page.entity_copy_reference':
+                $output = '';
+                $output .= '<h3>' . $this->t('About') . '</h3>';
+                $output .= '<p>' . $this->t('Module for easy one click node copy/clone creation') . '</p>' . '<p>' . $this->t('The module allows for configuration as to what referenced entities should be copied 
+        along with parent node (such as paragraphs or related content types') . '</p>';
+                return $output;
+            default:
+        }
+    }
+    /**
+     * Implements hook_local_tasks_alter().
+     */
+    #[Hook('local_tasks_alter', module: 'entity_copy_reference_menu')]
+    public function menuLocalTasksAlter(&$data, $route_name, &$cacheability)
+    {
+        // If not in edit or front end view.
+        if ($route_name !== 'entity.node.edit_form' && $route_name !== 'entity.node.canonical') {
+            return;
+        }
+        $node = \Drupal::routeMatch()->getParameter('node');
+        $entityCopyReference = new \Drupal\entity_copy_reference\EntityCopyReference();
+        if ($node->access('update') && $entityCopyReference->isCopyEnabled($node)) {
+            $data['tabs'][0]['entity_copy_reference.copy'] = [
+                '#theme' => 'menu_local_task',
+                '#link' => [
+                    'title' => $this->t('Copy'),
+                    'url' => \Drupal\Core\Url::fromRoute('entity_copy_reference.copy', [
+                        'node' => $node->id(),
+                    ]),
+                    'localized_options' => [
+                    ],
+                ],
+                '#weight' => 2,
+                '#active' => FALSE,
+                '#access' => 'use entity_copy_reference',
+            ];
+        }
+    }
+    /**
+     * Implements hook_entity_operation_alter().
+     */
+    #[Hook('entity_operation_alter')]
+    public function entityOperationAlter(&$operations, $entity)
+    {
+        if (!$entity instanceof \Drupal\node\Entity\Node) {
+            return;
+        }
+        $entityCopyReference = new \Drupal\entity_copy_reference\EntityCopyReference();
+        if ($entityCopyReference->isCopyEnabled($entity) && $entity->access('update')) {
+            $weight = array_key_exists('edit', $operations) ? $operations['edit']['weight'] + 1 : count($operations) + 1;
+            $operations['entity_copy_reference.copy'] = [
+                'title' => $this->t('Copy'),
+                'url' => \Drupal\Core\Url::fromRoute('entity_copy_reference.copy', [
+                    'node' => $entity->id(),
+                ]),
+                'weight' => $weight,
+            ];
+        }
+    }
+}
