diff --git a/inline_entity_form.api.php b/inline_entity_form.api.php
index 5c95fab..fb8dfdd 100644
--- a/inline_entity_form.api.php
+++ b/inline_entity_form.api.php
@@ -1,5 +1,7 @@
 <?php
 
+use Drupal\Core\Form\FormStateInterface;
+
 /**
  * @file
  * Hooks provided by the Inline Entity Form module.
@@ -15,7 +17,7 @@
  * @param \Drupal\Core\Form\FormStateInterface $form_state
  *   The form state of the parent form.
  */
-function hook_inline_entity_form_entity_form_alter(array &$entity_form, \Drupal\Core\Form\FormStateInterface &$form_state) {
+function hook_inline_entity_form_entity_form_alter(array &$entity_form, FormStateInterface &$form_state) {
   if ($entity_form['#entity_type'] == 'commerce_line_item') {
     $entity_form['quantity']['#description'] = t('New quantity description.');
   }
@@ -34,7 +36,7 @@ function hook_inline_entity_form_entity_form_alter(array &$entity_form, \Drupal\
  * @param \Drupal\Core\Form\FormStateInterface $form_state
  *   The form state of the parent form.
  */
-function hook_inline_entity_form_reference_form_alter(array &$reference_form, \Drupal\Core\Form\FormStateInterface &$form_state) {
+function hook_inline_entity_form_reference_form_alter(array &$reference_form, FormStateInterface &$form_state) {
   $reference_form['entity_id']['#description'] = t('New autocomplete description');
 }
 
diff --git a/inline_entity_form.module b/inline_entity_form.module
index 7bb004e..fda9493 100644
--- a/inline_entity_form.module
+++ b/inline_entity_form.module
@@ -9,7 +9,8 @@
  * (for example, order -> line items), where the child entities are never
  * managed outside the parent form.
  */
-
+use Drupal\Core\Hook\Attribute\LegacyHook;
+use Drupal\inline_entity_form\Hook\InlineEntityFormHooks;
 use Drupal\Component\Utility\NestedArray;
 use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Render\Element;
@@ -24,40 +25,27 @@ use Drupal\migrate\Row;
 /**
  * Implements hook_entity_type_build().
  */
-function inline_entity_form_entity_type_build(array &$entity_types) {
-  /** @var \Drupal\Core\Entity\EntityTypeInterface[] $entity_types */
-  if (isset($entity_types['node']) && !$entity_types['node']->getHandlerClass('inline_form')) {
-    $entity_types['node']->setHandlerClass('inline_form', '\Drupal\inline_entity_form\Form\NodeInlineForm');
-  }
-
-  foreach ($entity_types as &$entity_type) {
-    if (!$entity_type->hasHandlerClass('inline_form')) {
-      $entity_type->setHandlerClass('inline_form', '\Drupal\inline_entity_form\Form\EntityInlineForm');
-    }
-  }
+#[LegacyHook]
+function inline_entity_form_entity_type_build(array &$entity_types)
+{
+    \Drupal::service(InlineEntityFormHooks::class)->entityTypeBuild($entity_types);
 }
 
 /**
  * Implements hook_form_alter().
  */
-function inline_entity_form_form_alter(&$form, FormStateInterface $form_state, $form_id) {
-  // Attach the IEF handlers only if the current form has an IEF widget.
-  $widget_state = $form_state->get('inline_entity_form');
-  if (!is_null($widget_state)) {
-    ElementSubmit::attach($form, $form_state);
-    WidgetSubmit::attach($form, $form_state);
-  }
+#[LegacyHook]
+function inline_entity_form_form_alter(&$form, FormStateInterface $form_state, $form_id)
+{
+    \Drupal::service(InlineEntityFormHooks::class)->formAlter($form, $form_state, $form_id);
 }
 
 /**
  * Implements hook_theme().
  */
+#[LegacyHook]
 function inline_entity_form_theme() {
-  return [
-    'inline_entity_form_entity_table' => [
-      'render element' => 'form',
-    ],
-  ];
+  return \Drupal::service(InlineEntityFormHooks::class)->theme();
 }
 
 /**
@@ -475,15 +463,15 @@ function template_preprocess_inline_entity_form_entity_table(array &$variables)
 /**
  * Implements hook_migrate_prepare_row().
  */
+#[LegacyHook]
 function inline_entity_form_migrate_prepare_row(Row $row, MigrateSourceInterface $source, MigrationInterface $migration) {
-  \Drupal::service('inline_entity_form.migration_helper')
-    ->alterRow($row, $source, $migration);
+  \Drupal::service(InlineEntityFormHooks::class)->migratePrepareRow($row, $source, $migration);
 }
 
 /**
  * Implements hook_migration_plugins_alter().
  */
+#[LegacyHook]
 function inline_entity_form_migration_plugins_alter(array &$migrations) {
-  \Drupal::service('inline_entity_form.migration_helper')
-    ->alterPlugins($migrations);
+  \Drupal::service(InlineEntityFormHooks::class)->migrationPluginsAlter($migrations);
 }
diff --git a/inline_entity_form.services.yml b/inline_entity_form.services.yml
index e270e1d..abd6c5a 100644
--- a/inline_entity_form.services.yml
+++ b/inline_entity_form.services.yml
@@ -2,3 +2,7 @@ services:
   inline_entity_form.migration_helper:
     class: Drupal\inline_entity_form\MigrationHelper
     arguments: ['@?plugin.manager.migrate.source']
+
+  Drupal\inline_entity_form\Hook\InlineEntityFormHooks:
+    class: Drupal\inline_entity_form\Hook\InlineEntityFormHooks
+    autowire: true
diff --git a/src/Hook/InlineEntityFormHooks.php b/src/Hook/InlineEntityFormHooks.php
new file mode 100644
index 0000000..16fdfc8
--- /dev/null
+++ b/src/Hook/InlineEntityFormHooks.php
@@ -0,0 +1,78 @@
+<?php
+
+namespace Drupal\inline_entity_form\Hook;
+
+use Drupal\Component\Utility\NestedArray;
+use Drupal\Core\Form\FormStateInterface;
+use Drupal\Core\Render\Element;
+use Drupal\inline_entity_form\ElementSubmit;
+use Drupal\inline_entity_form\Form\EntityInlineForm;
+use Drupal\inline_entity_form\Plugin\Field\FieldWidget\InlineEntityFormComplex;
+use Drupal\inline_entity_form\WidgetSubmit;
+use Drupal\migrate\Plugin\MigrateSourceInterface;
+use Drupal\migrate\Plugin\MigrationInterface;
+use Drupal\migrate\Row;
+use Drupal\Core\Hook\Attribute\Hook;
+/**
+ * Hook implementations for inline_entity_form.
+ */
+class InlineEntityFormHooks
+{
+    /**
+     * Implements hook_entity_type_build().
+     */
+    #[Hook('entity_type_build')]
+    public static function entityTypeBuild(array &$entity_types)
+    {
+        /** @var \Drupal\Core\Entity\EntityTypeInterface[] $entity_types */
+        if (isset($entity_types['node']) && !$entity_types['node']->getHandlerClass('inline_form')) {
+            $entity_types['node']->setHandlerClass('inline_form', '\Drupal\inline_entity_form\Form\NodeInlineForm');
+        }
+        foreach ($entity_types as &$entity_type) {
+            if (!$entity_type->hasHandlerClass('inline_form')) {
+                $entity_type->setHandlerClass('inline_form', '\Drupal\inline_entity_form\Form\EntityInlineForm');
+            }
+        }
+    }
+    /**
+     * Implements hook_form_alter().
+     */
+    #[Hook('form_alter')]
+    public static function formAlter(&$form, \Drupal\Core\Form\FormStateInterface $form_state, $form_id)
+    {
+        // Attach the IEF handlers only if the current form has an IEF widget.
+        $widget_state = $form_state->get('inline_entity_form');
+        if (!is_null($widget_state)) {
+            \Drupal\inline_entity_form\ElementSubmit::attach($form, $form_state);
+            \Drupal\inline_entity_form\WidgetSubmit::attach($form, $form_state);
+        }
+    }
+    /**
+     * Implements hook_theme().
+     */
+    #[Hook('theme')]
+    public static function theme()
+    {
+        return [
+            'inline_entity_form_entity_table' => [
+                'render element' => 'form',
+            ],
+        ];
+    }
+    /**
+     * Implements hook_migrate_prepare_row().
+     */
+    #[Hook('migrate_prepare_row')]
+    public static function migratePrepareRow(\Drupal\migrate\Row $row, \Drupal\migrate\Plugin\MigrateSourceInterface $source, \Drupal\migrate\Plugin\MigrationInterface $migration)
+    {
+        \Drupal::service('inline_entity_form.migration_helper')->alterRow($row, $source, $migration);
+    }
+    /**
+     * Implements hook_migration_plugins_alter().
+     */
+    #[Hook('migration_plugins_alter')]
+    public static function migrationPluginsAlter(array &$migrations)
+    {
+        \Drupal::service('inline_entity_form.migration_helper')->alterPlugins($migrations);
+    }
+}
diff --git a/src/MigrationHelper.php b/src/MigrationHelper.php
index 15d9513..2afb54a 100644
--- a/src/MigrationHelper.php
+++ b/src/MigrationHelper.php
@@ -2,6 +2,7 @@
 
 namespace Drupal\inline_entity_form;
 
+use Drupal\migrate_plus\Entity\MigrationGroup;
 use Drupal\Component\Utility\NestedArray;
 use Drupal\field\Plugin\migrate\source\d7\FieldInstance;
 use Drupal\field\Plugin\migrate\source\d7\FieldInstancePerFormDisplay;
@@ -174,7 +175,7 @@ class MigrationHelper {
     // Integrate shared group configuration into the migration.
     if (!empty($migration['migration_group']) && class_exists('\Drupal\migrate_plus\Entity\MigrationGroup')) {
       // phpcs:ignore Drupal.Classes.FullyQualifiedNamespace
-      $group = \Drupal\migrate_plus\Entity\MigrationGroup::load($migration['migration_group']);
+      $group = MigrationGroup::load($migration['migration_group']);
       $shared_configuration = !empty($group) ? $group->get('shared_configuration') : [];
       if (!empty($shared_configuration)) {
         foreach ($shared_configuration as $key => $group_value) {
