diff --git a/simple_access.module b/simple_access.module
index eb70db0..879feb8 100644
--- a/simple_access.module
+++ b/simple_access.module
@@ -10,60 +10,35 @@
  * by all users.
  */
 
+use Drupal\Core\Hook\Attribute\LegacyHook;
+use Drupal\simple_access\Hook\SimpleAccessHooks;
 use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Session\AccountInterface;
-use Drupal\node\Entity\NodeType;
 use Drupal\node\NodeInterface;
 use Drupal\node\NodeTypeInterface;
-use Drupal\simple_access\Entity\SimpleAccessGroup;
-use Drupal\simple_access\Entity\SimpleAccessProfile;
 
 /**
  * Implements hook_node_load().
  */
+#[LegacyHook]
 function simple_access_node_load(array $nodes) {
-
-  $nids = [];
-  foreach ($nodes as $nid => $node) {
-    $nids[] = $nid;
-    $node->simple_access = [];
-  }
-
-  $groups = \Drupal::database()->select('simple_access_node_group', 'na')
-    ->fields('na', ['nid', 'gid', 'grant_view', 'grant_update', 'grant_delete'])
-    ->condition('nid', $nids, 'IN')
-    ->execute()
-    ->fetchAll(PDO::FETCH_ASSOC);
-
-  $profiles = \Drupal::database()->select('simple_access_node_profile', 'pn')
-    ->fields('pn', ['nid', 'pid'])
-    ->condition('nid', $nids, 'IN')
-    ->execute()
-    ->fetchAll(PDO::FETCH_ASSOC);
-
-  foreach ($groups as $row) {
-    $nodes[$row['nid']]->simple_access['groups'][$row['gid']] = array_combine(
-      ['nid', 'gid', 'view', 'update', 'delete'],
-      $row
-    );
-  }
-  foreach ($profiles as $row) {
-    $nodes[$row['nid']]->simple_access['profiles'][$row['pid']] = $row['pid'];
-  }
+  \Drupal::service(SimpleAccessHooks::class)->nodeLoad($nodes);
 }
 
 /**
  * Implements hook_node_insert().
  */
+#[LegacyHook]
 function simple_access_node_insert(NodeInterface $node) {
-  simple_access_node_save($node);
+  \Drupal::service(SimpleAccessHooks::class)->nodeInsert($node);
 }
 
 /**
  * Implements hook_node_update().
  */
+#[LegacyHook]
 function simple_access_node_update(NodeInterface $node) {
-  simple_access_node_save($node);
+  \Drupal::service(SimpleAccessHooks::class)->nodeUpdate($node);
 }
 
 /**
@@ -108,94 +83,33 @@ function simple_access_node_save(NodeInterface $node) {
 /**
  * Implements hook_node_delete().
  */
+#[LegacyHook]
 function simple_access_node_delete(NodeInterface $node) {
-  foreach (['simple_access_node_group', 'simple_access_node_profile'] as $table) {
-    \Drupal::database()->delete($table)
-      ->condition('nid', $node->id())
-      ->execute();
-  }
+  \Drupal::service(SimpleAccessHooks::class)->nodeDelete($node);
 }
 
 /**
  * Implements hook_node_access_records().
  */
+#[LegacyHook]
 function simple_access_node_access_records(NodeInterface $node) {
-  $records = [];
-
-  if (!empty($node->simple_access['profiles'])) {
-    foreach (array_filter($node->simple_access['profiles']) as $pid) {
-      $records[] = [
-        'realm' => 'simple_access_profile:' . $pid,
-        'gid' => 0,
-        'grant_view' => 1,
-        'grant_update' => 1,
-        'grant_delete' => 1,
-        'priority' => 0,
-      ];
-    }
-  }
-
-  if (!empty($node->simple_access['groups'])) {
-    // Loop through simple_access arrays from page submission
-    // $type is either 'view', 'update', or 'delete'.
-    foreach ($node->simple_access['groups'] as $gid => $access) {
-      if ($access['view'] || $access['update'] || $access['delete']) {
-        $id = $gid === 'owner' ? $node->getOwnerId() : 0;
-        $records[] = [
-          'realm' => 'simple_access_group:' . $gid,
-          'gid' => $id,
-          'grant_view' => $access['view'] ?? 0,
-          'grant_update' => $access['update'] ?? 0,
-          'grant_delete' => $access['delete'] ?? 0,
-          'priority' => 0,
-        ];
-      }
-    }
-  }
-
-  return $records;
+  return \Drupal::service(SimpleAccessHooks::class)->nodeAccessRecords($node);
 }
 
 /**
  * Implements hook_node_grants().
  */
+#[LegacyHook]
 function simple_access_node_grants(AccountInterface $account, $op) {
-  $grants = [];
-  $groups = SimpleAccessGroup::loadMultiple();
-  $profiles = SimpleAccessProfile::loadMultiple();
-
-  /** @var \Drupal\simple_access\Entity\SimpleAccessGroup $group */
-  foreach ($groups as $group) {
-    if ($grant = $group->buildGrant($account, $op)) {
-      $grants = array_merge_recursive($grants, $grant);
-    }
-  }
-
-  /** @var \Drupal\simple_access\Entity\SimpleAccessProfile $profile */
-  foreach ($profiles as $profile) {
-    if ($grant = $profile->buildGrant($account, $op)) {
-      $grants = array_merge_recursive($grants, $grant);
-    }
-  }
-
-  return $grants;
+  return \Drupal::service(SimpleAccessHooks::class)->nodeGrants($account, $op);
 }
 
 /**
  * Implements hook_entity_extra_field_info().
  */
+#[LegacyHook]
 function simple_access_entity_extra_field_info() {
-  $fields = [];
-
-  foreach (NodeType::loadMultiple() as $bundle) {
-    $fields['node'][$bundle->id()]['form']['simple_access'] = [
-      'label' => t('Simple Access'),
-      'description' => t('Simple Access module form.'),
-      'weight' => 20,
-    ];
-  }
-
-  return $fields;
+  return \Drupal::service(SimpleAccessHooks::class)->entityExtraFieldInfo();
 }
 
 /**
@@ -203,16 +117,9 @@ function simple_access_entity_extra_field_info() {
  *
  * For node_form.
  */
+#[LegacyHook]
 function simple_access_form_node_form_alter(&$form, FormStateInterface $form_state, $form_id) {
-  /** @var \Drupal\node\Entity\Node $node */
-  $node = $form_state->getFormObject()->getEntity();
-
-  // Build the simple access form.
-  if ($simple_access_form = simple_access_form($node->bundle(), $node->simple_access)) {
-    $simple_access_form['simple_access']['#group'] = 'advanced';
-    $form = array_merge($form, $simple_access_form);
-    $form['#entity_builders'][] = 'simple_access_form_node_form_builder';
-  }
+  \Drupal::service(SimpleAccessHooks::class)->formNodeFormAlter($form, $form_state, $form_id);
 }
 
 /**
@@ -227,21 +134,9 @@ function simple_access_form_node_form_builder($entity_type, NodeInterface $node,
  *
  * For node_type_form.
  */
+#[LegacyHook]
 function simple_access_form_node_type_form_alter(&$form, FormStateInterface $form_state) {
-  /** @var \Drupal\node\NodeTypeInterface $node_type */
-  $node_type = $form_state->getFormObject()->getEntity();
-  $settings = $node_type->getThirdPartySettings('simple_access');
-  $tmp_form = simple_access_form($node_type->id(), $settings, TRUE);
-
-  $tmp_form['simple_access']['#group'] = 'additional_settings';
-  $tmp_form['simple_access']['#attached'] = [
-    'library' => [
-      'simple_access/simple_access.content',
-    ],
-  ];
-
-  $form['simple_access'] = $tmp_form['simple_access'];
-  $form['#entity_builders'][] = 'simple_access_form_node_type_form_builder';
+  \Drupal::service(SimpleAccessHooks::class)->formNodeTypeFormAlter($form, $form_state);
 }
 
 /**
@@ -282,12 +177,12 @@ function simple_access_form($type_id, $access, $admin = FALSE) {
       '#node_type' => $type_id,
     ],
     '#access' => $user->hasPermission('assign owner permissions') ||
-      $user->hasPermission("assign owner permissions for $type_id") ||
-      $user->hasPermission('assign groups to nodes') ||
-      $user->hasPermission("assign groups to $type_id nodes") ||
-      $user->hasPermission('assign profiles to nodes') ||
-      $user->hasPermission("assign profiles to $type_id nodes") ||
-      $user->hasPermission('administer nodes'),
+    $user->hasPermission("assign owner permissions for $type_id") ||
+    $user->hasPermission('assign groups to nodes') ||
+    $user->hasPermission("assign groups to $type_id nodes") ||
+    $user->hasPermission('assign profiles to nodes') ||
+    $user->hasPermission("assign profiles to $type_id nodes") ||
+    $user->hasPermission('administer nodes'),
   ];
 
   return $form;
diff --git a/simple_access.services.yml b/simple_access.services.yml
new file mode 100644
index 0000000..3092807
--- /dev/null
+++ b/simple_access.services.yml
@@ -0,0 +1,5 @@
+
+services:
+  Drupal\simple_access\Hook\SimpleAccessHooks:
+    class: Drupal\simple_access\Hook\SimpleAccessHooks
+    autowire: true
diff --git a/src/Hook/SimpleAccessHooks.php b/src/Hook/SimpleAccessHooks.php
new file mode 100644
index 0000000..1daa159
--- /dev/null
+++ b/src/Hook/SimpleAccessHooks.php
@@ -0,0 +1,210 @@
+<?php
+
+namespace Drupal\simple_access\Hook;
+
+use Drupal\Core\Form\FormStateInterface;
+use Drupal\node\Entity\NodeType;
+use Drupal\simple_access\Entity\SimpleAccessProfile;
+use Drupal\simple_access\Entity\SimpleAccessGroup;
+use Drupal\Core\Session\AccountInterface;
+use Drupal\node\NodeInterface;
+use Drupal\Core\Database\Statement\FetchAs;
+use Drupal\Component\Utility\DeprecationHelper;
+use Drupal\Core\Hook\Attribute\Hook;
+use Drupal\Core\StringTranslation\StringTranslationTrait;
+
+/**
+ * Hook implementations for simple_access.
+ */
+class SimpleAccessHooks {
+  use StringTranslationTrait;
+
+  /**
+   * Implements hook_node_load().
+   */
+  #[Hook('node_load')]
+  public function nodeLoad(array $nodes) {
+    $nids = [];
+    foreach ($nodes as $nid => $node) {
+      $nids[] = $nid;
+      $node->simple_access = [];
+    }
+    $groups = DeprecationHelper::backwardsCompatibleCall(\Drupal::VERSION, '11.2.0', fn() => \Drupal::database()->select('simple_access_node_group', 'na')->fields('na', [
+      'nid',
+      'gid',
+      'grant_view',
+      'grant_update',
+      'grant_delete',
+    ])->condition('nid', $nids, 'IN')->execute()->fetchAll(FetchAs::Associative), fn() => \Drupal::database()->select('simple_access_node_group', 'na')->fields('na', [
+      'nid',
+      'gid',
+      'grant_view',
+      'grant_update',
+      'grant_delete',
+    ])->condition('nid', $nids, 'IN')->execute()->fetchAll(\PDO::FETCH_ASSOC));
+    $profiles = DeprecationHelper::backwardsCompatibleCall(\Drupal::VERSION, '11.2.0', fn() => \Drupal::database()->select('simple_access_node_profile', 'pn')->fields('pn', [
+      'nid',
+      'pid',
+    ])->condition('nid', $nids, 'IN')->execute()->fetchAll(FetchAs::Associative), fn() => \Drupal::database()->select('simple_access_node_profile', 'pn')->fields('pn', [
+      'nid',
+      'pid',
+    ])->condition('nid', $nids, 'IN')->execute()->fetchAll(\PDO::FETCH_ASSOC));
+    foreach ($groups as $row) {
+      $nodes[$row['nid']]->simple_access['groups'][$row['gid']] = array_combine([
+        'nid',
+        'gid',
+        'view',
+        'update',
+        'delete',
+      ], $row);
+    }
+    foreach ($profiles as $row) {
+      $nodes[$row['nid']]->simple_access['profiles'][$row['pid']] = $row['pid'];
+    }
+  }
+
+  /**
+   * Implements hook_node_insert().
+   */
+  #[Hook('node_insert')]
+  public function nodeInsert(NodeInterface $node) {
+    simple_access_node_save($node);
+  }
+
+  /**
+   * Implements hook_node_update().
+   */
+  #[Hook('node_update')]
+  public function nodeUpdate(NodeInterface $node) {
+    simple_access_node_save($node);
+  }
+
+  /**
+   * Implements hook_node_delete().
+   */
+  #[Hook('node_delete')]
+  public function nodeDelete(NodeInterface $node) {
+    foreach ([
+      'simple_access_node_group',
+      'simple_access_node_profile',
+    ] as $table) {
+      \Drupal::database()->delete($table)->condition('nid', $node->id())->execute();
+    }
+  }
+
+  /**
+   * Implements hook_node_access_records().
+   */
+  #[Hook('node_access_records')]
+  public function nodeAccessRecords(NodeInterface $node) {
+    $records = [];
+    if (!empty($node->simple_access['profiles'])) {
+      foreach (array_filter($node->simple_access['profiles']) as $pid) {
+        $records[] = [
+          'realm' => 'simple_access_profile:' . $pid,
+          'gid' => 0,
+          'grant_view' => 1,
+          'grant_update' => 1,
+          'grant_delete' => 1,
+          'priority' => 0,
+        ];
+      }
+    }
+    if (!empty($node->simple_access['groups'])) {
+      // Loop through simple_access arrays from page submission
+      // $type is either 'view', 'update', or 'delete'.
+      foreach ($node->simple_access['groups'] as $gid => $access) {
+        if ($access['view'] || $access['update'] || $access['delete']) {
+          $id = $gid === 'owner' ? $node->getOwnerId() : 0;
+          $records[] = [
+            'realm' => 'simple_access_group:' . $gid,
+            'gid' => $id,
+            'grant_view' => $access['view'] ?? 0,
+            'grant_update' => $access['update'] ?? 0,
+            'grant_delete' => $access['delete'] ?? 0,
+            'priority' => 0,
+          ];
+        }
+      }
+    }
+    return $records;
+  }
+
+  /**
+   * Implements hook_node_grants().
+   */
+  #[Hook('node_grants')]
+  public function nodeGrants(AccountInterface $account, $op) {
+    $grants = [];
+    $groups = SimpleAccessGroup::loadMultiple();
+    $profiles = SimpleAccessProfile::loadMultiple();
+    /** @var \Drupal\simple_access\Entity\SimpleAccessGroup $group */
+    foreach ($groups as $group) {
+      if ($grant = $group->buildGrant($account, $op)) {
+        $grants = array_merge_recursive($grants, $grant);
+      }
+    }
+    /** @var \Drupal\simple_access\Entity\SimpleAccessProfile $profile */
+    foreach ($profiles as $profile) {
+      if ($grant = $profile->buildGrant($account, $op)) {
+        $grants = array_merge_recursive($grants, $grant);
+      }
+    }
+    return $grants;
+  }
+
+  /**
+   * Implements hook_entity_extra_field_info().
+   */
+  #[Hook('entity_extra_field_info')]
+  public function entityExtraFieldInfo() {
+    $fields = [];
+    foreach (NodeType::loadMultiple() as $bundle) {
+      $fields['node'][$bundle->id()]['form']['simple_access'] = [
+        'label' => $this->t('Simple Access'),
+        'description' => $this->t('Simple Access module form.'),
+        'weight' => 20,
+      ];
+    }
+    return $fields;
+  }
+
+  /**
+   * Implements hook_form_FORM_ID_alter().
+   *
+   * For node_form.
+   */
+  #[Hook('form_node_form_alter')]
+  public function formNodeFormAlter(&$form, FormStateInterface $form_state, $form_id) {
+    /** @var \Drupal\node\Entity\Node $node */
+    $node = $form_state->getFormObject()->getEntity();
+    // Build the simple access form.
+    if ($simple_access_form = simple_access_form($node->bundle(), $node->simple_access)) {
+      $simple_access_form['simple_access']['#group'] = 'advanced';
+      $form = array_merge($form, $simple_access_form);
+      $form['#entity_builders'][] = 'simple_access_form_node_form_builder';
+    }
+  }
+
+  /**
+   * Implements hook_form_FORM_ID_alter().
+   *
+   * For node_type_form.
+   */
+  #[Hook('form_node_type_form_alter')]
+  public function formNodeTypeFormAlter(&$form, FormStateInterface $form_state) {
+    /** @var \Drupal\node\NodeTypeInterface $node_type */
+    $node_type = $form_state->getFormObject()->getEntity();
+    $settings = $node_type->getThirdPartySettings('simple_access');
+    $tmp_form = simple_access_form($node_type->id(), $settings, TRUE);
+    $tmp_form['simple_access']['#group'] = 'additional_settings';
+    $tmp_form['simple_access']['#attached'] = [
+      'library' => [
+        'simple_access/simple_access.content',
+      ],
+    ];
+    $form['simple_access'] = $tmp_form['simple_access'];
+    $form['#entity_builders'][] = 'simple_access_form_node_type_form_builder';
+  }
+
+}
diff --git a/src/Plugin/migrate/destination/SimpleAccessNodeGroup.php b/src/Plugin/migrate/destination/SimpleAccessNodeGroup.php
index f51f623..8a1a893 100644
--- a/src/Plugin/migrate/destination/SimpleAccessNodeGroup.php
+++ b/src/Plugin/migrate/destination/SimpleAccessNodeGroup.php
@@ -56,7 +56,7 @@ class SimpleAccessNodeGroup extends DestinationBase implements ContainerFactoryP
   /**
    * {@inheritdoc}
    */
-  public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition, MigrationInterface $migration = NULL) {
+  public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition, ?MigrationInterface $migration = NULL) {
     return new static(
       $configuration,
       $plugin_id,
