diff --git a/module_builder.install b/module_builder.install
index 7d937fc..16b7575 100644
--- a/module_builder.install
+++ b/module_builder.install
@@ -4,7 +4,7 @@
  * @file module_builder.install
  * Contains install hooks.
  */
-
+use Drupal\Component\Utility\DeprecationHelper;
 use Drupal\Core\Extension\Requirement\RequirementSeverity;
 use Drupal\module_builder\LibraryWrapper;
 
@@ -30,7 +30,7 @@ function module_builder_requirements($phase) {
         'description' => t("The Drupal Code Builder library could not be initialised. Check README.txt for instructions. Error message was: @message.", [
           '@message' => $e->getMessage(),
         ]),
-        'severity' => enum_exists(RequirementSeverity::class) ? RequirementSeverity::Error : REQUIREMENT_ERROR,
+        'severity' => enum_exists(RequirementSeverity::class) ? RequirementSeverity::Error : DeprecationHelper::backwardsCompatibleCall(\Drupal::VERSION, '11.2.0', fn() => RequirementSeverity::Error, fn() => REQUIREMENT_ERROR),
       );
     }
   }
diff --git a/module_builder.module b/module_builder.module
index 0cfd2bd..adfded2 100644
--- a/module_builder.module
+++ b/module_builder.module
@@ -1,5 +1,7 @@
 <?php
 
+use Drupal\Core\Hook\Attribute\LegacyHook;
+use Drupal\module_builder\Hook\ModuleBuilderHooks;
 use Drupal\Core\Routing\RouteMatchInterface;
 use Drupal\module_builder\Form\ModuleMiscForm;
 use Drupal\module_builder\Form\ComponentSectionForm;
@@ -13,26 +15,17 @@ use Drupal\Core\Render\Element;
 /**
  * Implements hook_help().
  */
+#[LegacyHook]
 function module_builder_help($route_name, RouteMatchInterface $route_match) {
-  switch ($route_name) {
-    case 'help.page.module_builder':
-      return t("Module builder allows you to generate code files for new custom modules.");
-    case 'entity.module_builder_module.collection':
-      return t('This page allows you to generate the files for a custom module with scaffolding code for hook implementations, plugins, and so on.');
-    case 'entity.module_builder_module.adopt_form':
-      return t('Use this form to adopt components from the existing module files into the generated module. This allows existing components to be enhanced.');
-  }
+  return \Drupal::service(ModuleBuilderHooks::class)->help($route_name, $route_match);
 }
 
 /**
  * Implements hook_theme().
  */
+#[LegacyHook]
 function module_builder_theme($existing, $type, $theme, $path) {
-  return [
-    'generated_files' => [
-      'render element' => 'element',
-    ],
-  ];
+  return \Drupal::service(ModuleBuilderHooks::class)->theme($existing, $type, $theme, $path);
 }
 
 /**
@@ -59,39 +52,8 @@ function template_preprocess_generated_files(&$variables) {
 /**
  * Implements hook_entity_type_build().
  */
-function module_builder_entity_type_build(array &$entity_types) {
-  $entity_type_manager = \Drupal::service('entity_type.manager');
-
-  // Process the 'code_builder' entity type annotation.
-  foreach ($entity_types as $entity_type_id => $entity_type) {
-    if (!$entity_type->hasHandlerClass('component_sections')) {
-      continue;
-    }
-
-    // Can't use $entity_type_manager->getHandler() here, as that will call
-    // getDefinition() and create circularity.
-    $handler_class = $entity_type->getHandlerClass('component_sections');
-    $component_sections_handler = $entity_type_manager->createHandlerInstance($handler_class, $entity_type);
-
-    // Expand form properties in the entity type annotation to set form classes,
-    // entity links templates, etc.
-    $form_operations = $component_sections_handler->getFormOperations();
-
-    // Set a generic form class for the 'misc' section if not specified.
-    if (empty($entity_type->getFormClass('misc'))) {
-      $entity_type->setFormClass('misc', ModuleMiscForm::class);
-    }
-
-    $canonical_template = $entity_type->getLinkTemplate('edit-form');
-    foreach ($form_operations as $form_op) {
-      // Allow the entity type to specify a form class.
-      if (empty($entity_type->getFormClass($form_op))) {
-        $entity_type->setFormClass($form_op, ComponentSectionForm::class);
-      }
-
-      // TODO: this is clobbering link templates in the entity if they are set
-      // in the annotation -- bad DX! Either don't clobber, or complain.
-      $entity_type->setLinkTemplate("{$form_op}-form", $canonical_template . '/' . $form_op);
-    }
-  }
+#[LegacyHook]
+function module_builder_entity_type_build(array &$entity_types)
+{
+    \Drupal::service(ModuleBuilderHooks::class)->entityTypeBuild($entity_types);
 }
diff --git a/module_builder.services.yml b/module_builder.services.yml
index fc5fab1..66d7d39 100644
--- a/module_builder.services.yml
+++ b/module_builder.services.yml
@@ -11,3 +11,7 @@ services:
   logger.channel.module_builder:
     parent: logger.channel_base
     arguments: ['module_builder']
+
+  Drupal\module_builder\Hook\ModuleBuilderHooks:
+    class: Drupal\module_builder\Hook\ModuleBuilderHooks
+    autowire: true
diff --git a/module_builder_devel/module_builder_devel.module b/module_builder_devel/module_builder_devel.module
index 5351fb7..6039dc3 100644
--- a/module_builder_devel/module_builder_devel.module
+++ b/module_builder_devel/module_builder_devel.module
@@ -1,15 +1,16 @@
 <?php
 
+use Drupal\Core\Hook\Attribute\LegacyHook;
+use Drupal\module_builder_devel\Hook\ModuleBuilderDevelHooks;
+
 /**
  * @file
  * Contains hook implementations for the module_builder_devel module.
  */
-
 /**
  * Implements hook_entity_type_alter().
  */
+#[LegacyHook]
 function module_builder_devel_entity_type_alter(array &$entity_types) {
-  /** @var \Drupal\Core\Entity\EntityTypeInterface[] $entity_types */
-  // Replace the list builder with an override which adds links to issues.
-  $entity_types['module_builder_module']->setHandlerClass('list_builder', 'Drupal\module_builder_devel\EntityHandler\ModuleBuilderDevelComponentListBuilder');
+  \Drupal::service(ModuleBuilderDevelHooks::class)->entityTypeAlter($entity_types);
 }
diff --git a/module_builder_devel/module_builder_devel.services.yml b/module_builder_devel/module_builder_devel.services.yml
index 0cebf00..9a7330c 100644
--- a/module_builder_devel/module_builder_devel.services.yml
+++ b/module_builder_devel/module_builder_devel.services.yml
@@ -12,3 +12,7 @@ services:
   # Alternative DCB service: writes to DCB's test sample location.
   module_builder_devel.drupal_code_builder.test_samples:
     class: Drupal\module_builder_devel\DrupalCodeBuilderTestSamples
+
+  Drupal\module_builder_devel\Hook\ModuleBuilderDevelHooks:
+    class: Drupal\module_builder_devel\Hook\ModuleBuilderDevelHooks
+    autowire: true
diff --git a/module_builder_devel/src/Hook/ModuleBuilderDevelHooks.php b/module_builder_devel/src/Hook/ModuleBuilderDevelHooks.php
new file mode 100644
index 0000000..5e8a421
--- /dev/null
+++ b/module_builder_devel/src/Hook/ModuleBuilderDevelHooks.php
@@ -0,0 +1,25 @@
+<?php
+
+namespace Drupal\module_builder_devel\Hook;
+
+use Drupal\Core\Hook\Attribute\Hook;
+/**
+ * Hook implementations for module_builder_devel.
+ */
+class ModuleBuilderDevelHooks
+{
+    /**
+     * @file
+     * Contains hook implementations for the module_builder_devel module.
+     */
+    /**
+     * Implements hook_entity_type_alter().
+     */
+    #[Hook('entity_type_alter')]
+    public function entityTypeAlter(array &$entity_types)
+    {
+        /** @var \Drupal\Core\Entity\EntityTypeInterface[] $entity_types */
+        // Replace the list builder with an override which adds links to issues.
+        $entity_types['module_builder_module']->setHandlerClass('list_builder', 'Drupal\module_builder_devel\EntityHandler\ModuleBuilderDevelComponentListBuilder');
+    }
+}
diff --git a/src/Form/ComponentSectionForm.php b/src/Form/ComponentSectionForm.php
index 749494e..82a2f4b 100644
--- a/src/Form/ComponentSectionForm.php
+++ b/src/Form/ComponentSectionForm.php
@@ -2,6 +2,8 @@
 
 namespace Drupal\module_builder\Form;
 
+use DrupalCodeBuilder\MutableTypedData\DrupalCodeBuilderDataItemFactory;
+use Drupal\Component\Utility\DeprecationHelper;
 use Drupal\Component\Utility\Html;
 use Drupal\Component\Utility\NestedArray;
 use Drupal\Core\Ajax\AjaxResponse;
@@ -787,7 +789,7 @@ class ComponentSectionForm extends ComponentFormBase {
 
       // Build dummy data for the type property, to create a standalone
       // form element for it.
-      $type_property_dummy_data = \DrupalCodeBuilder\MutableTypedData\DrupalCodeBuilderDataItemFactory::createFromDefinition($type_property);
+      $type_property_dummy_data = DrupalCodeBuilderDataItemFactory::createFromDefinition($type_property);
       $type_property_element = [];
       $type_property_element = $this->buildSingleFormElement($type_property_element, $form_state, $type_property_dummy_data);
 
@@ -1557,7 +1559,7 @@ class ComponentSectionForm extends ComponentFormBase {
       $data->set($data_values);
     }
     catch (InvalidInputException $e) {
-      \Drupal\Component\Utility\DeprecationHelper::backwardsCompatibleCall(
+      DeprecationHelper::backwardsCompatibleCall(
         \Drupal::VERSION,
         '10.1.0',
         fn() => Error::logException(\Drupal::logger('module_builder'), $e),
diff --git a/src/Hook/ModuleBuilderHooks.php b/src/Hook/ModuleBuilderHooks.php
new file mode 100644
index 0000000..96f32e1
--- /dev/null
+++ b/src/Hook/ModuleBuilderHooks.php
@@ -0,0 +1,79 @@
+<?php
+
+namespace Drupal\module_builder\Hook;
+
+use Drupal\Core\Routing\RouteMatchInterface;
+use Drupal\module_builder\Form\ModuleMiscForm;
+use Drupal\module_builder\Form\ComponentSectionForm;
+use Drupal\Core\Render\Element;
+use Drupal\Core\Hook\Attribute\Hook;
+use Drupal\Core\StringTranslation\StringTranslationTrait;
+/**
+ * Hook implementations for module_builder.
+ */
+class ModuleBuilderHooks
+{
+    use StringTranslationTrait;
+    /**
+     * Implements hook_help().
+     */
+    #[Hook('help')]
+    public function help($route_name, \Drupal\Core\Routing\RouteMatchInterface $route_match)
+    {
+        switch ($route_name) {
+            case 'help.page.module_builder':
+                return $this->t("Module builder allows you to generate code files for new custom modules.");
+            case 'entity.module_builder_module.collection':
+                return $this->t('This page allows you to generate the files for a custom module with scaffolding code for hook implementations, plugins, and so on.');
+            case 'entity.module_builder_module.adopt_form':
+                return $this->t('Use this form to adopt components from the existing module files into the generated module. This allows existing components to be enhanced.');
+        }
+    }
+    /**
+     * Implements hook_theme().
+     */
+    #[Hook('theme')]
+    public function theme($existing, $type, $theme, $path)
+    {
+        return [
+            'generated_files' => [
+                'render element' => 'element',
+            ],
+        ];
+    }
+    /**
+     * Implements hook_entity_type_build().
+     */
+    #[Hook('entity_type_build')]
+    public function entityTypeBuild(array &$entity_types)
+    {
+        $entity_type_manager = \Drupal::service('entity_type.manager');
+        // Process the 'code_builder' entity type annotation.
+        foreach ($entity_types as $entity_type_id => $entity_type) {
+            if (!$entity_type->hasHandlerClass('component_sections')) {
+                continue;
+            }
+            // Can't use $entity_type_manager->getHandler() here, as that will call
+            // getDefinition() and create circularity.
+            $handler_class = $entity_type->getHandlerClass('component_sections');
+            $component_sections_handler = $entity_type_manager->createHandlerInstance($handler_class, $entity_type);
+            // Expand form properties in the entity type annotation to set form classes,
+            // entity links templates, etc.
+            $form_operations = $component_sections_handler->getFormOperations();
+            // Set a generic form class for the 'misc' section if not specified.
+            if (empty($entity_type->getFormClass('misc'))) {
+                $entity_type->setFormClass('misc', \Drupal\module_builder\Form\ModuleMiscForm::class);
+            }
+            $canonical_template = $entity_type->getLinkTemplate('edit-form');
+            foreach ($form_operations as $form_op) {
+                // Allow the entity type to specify a form class.
+                if (empty($entity_type->getFormClass($form_op))) {
+                    $entity_type->setFormClass($form_op, \Drupal\module_builder\Form\ComponentSectionForm::class);
+                }
+                // TODO: this is clobbering link templates in the entity if they are set
+                // in the annotation -- bad DX! Either don't clobber, or complain.
+                $entity_type->setLinkTemplate("{$form_op}-form", $canonical_template . '/' . $form_op);
+            }
+        }
+    }
+}
diff --git a/tests/modules/module_builder_test_component_type/src/TestGenerateTask.php b/tests/modules/module_builder_test_component_type/src/TestGenerateTask.php
index 89d9161..740ace3 100644
--- a/tests/modules/module_builder_test_component_type/src/TestGenerateTask.php
+++ b/tests/modules/module_builder_test_component_type/src/TestGenerateTask.php
@@ -36,23 +36,23 @@ class TestGenerateTask extends Generate implements DefinitionProviderInterface {
 
     // The component form expects these to always exist.
     $definition->addProperty(
-      PropertyDefinition::create('string')
+      DataDefinition::create('string')
         ->setName('root_name')
         ->setLabel('Extension machine name')
     );
     $definition->addProperty(
-      PropertyDefinition::create('string')
+      DataDefinition::create('string')
         ->setName('readable_name')
         ->setLabel('Extension readable name')
     );
 
     // These need to be defined for the 'Name' form to work.
     $definition->addProperties([
-      'short_description' => PropertyDefinition::create('string')
+      'short_description' => DataDefinition::create('string')
         ->setLabel('Description'),
-      'module_package' => PropertyDefinition::create('string')
+      'module_package' => DataDefinition::create('string')
         ->setLabel('Package'),
-      'module_dependencies' => PropertyDefinition::create('string')
+      'module_dependencies' => DataDefinition::create('string')
         ->setLabel('Dependencies')
         ->setMultiple(TRUE),
     ]);
@@ -60,39 +60,39 @@ class TestGenerateTask extends Generate implements DefinitionProviderInterface {
     // These will show on the 'Misc' form because the entity annotation
     // doesn't declare them.
     $test_properties = [
-      'string_empty' => PropertyDefinition::create('string'),
-      'string_default' => PropertyDefinition::create('string')
+      'string_empty' => DataDefinition::create('string'),
+      'string_default' => DataDefinition::create('string')
         ->setLiteralDefault('default value'),
-      'checkbox_empty' => PropertyDefinition::create('boolean'),
-      'checkbox_default' => PropertyDefinition::create('boolean')
+      'checkbox_empty' => DataDefinition::create('boolean'),
+      'checkbox_default' => DataDefinition::create('boolean')
         ->setLiteralDefault(TRUE),
-      'radios_empty' => PropertyDefinition::create('string')
+      'radios_empty' => DataDefinition::create('string')
         ->setOptionsArray([
           'alpha' => 'alpha',
           'beta' => 'beta',
           'gamma' => 'gamma',
         ]),
-      'radios_default' => PropertyDefinition::create('string')
+      'radios_default' => DataDefinition::create('string')
         ->setOptionsArray([
           'alpha' => 'alpha',
           'beta' => 'beta',
           'gamma' => 'gamma',
         ])
         ->setLiteralDefault('beta'),
-      'array_empty' => PropertyDefinition::create('string')
+      'array_empty' => DataDefinition::create('string')
         ->setMultiple(TRUE),
-      'array_default' => PropertyDefinition::create('string')
+      'array_default' => DataDefinition::create('string')
         ->setMultiple(TRUE)
         ->setLiteralDefault([
           'value 1',
           'value 2',
         ]),
-      'compound_empty' => PropertyDefinition::create('complex')
+      'compound_empty' => DataDefinition::create('complex')
         ->setProperties([
-          'one' => PropertyDefinition::create('string')
+          'one' => DataDefinition::create('string')
             ->setLabel('one')
             ->setRequired(TRUE),
-          'two' => PropertyDefinition::create('string')
+          'two' => DataDefinition::create('string')
             ->setLabel('two'),
         ]),
       ];
diff --git a/tests/src/Functional/ComponentFormTest.php b/tests/src/Functional/ComponentFormTest.php
index 342381b..9ab0c50 100644
--- a/tests/src/Functional/ComponentFormTest.php
+++ b/tests/src/Functional/ComponentFormTest.php
@@ -2,6 +2,8 @@
 
 namespace Drupal\Tests\module_builder\Functional;
 
+use PHPUnit\Framework\Attributes\Group;
+use PHPUnit\Framework\Attributes\RunTestsInSeparateProcesses;
 use Drupal\Tests\BrowserTestBase;
 use Drupal\user\RoleInterface;
 
@@ -20,6 +22,8 @@ use Drupal\user\RoleInterface;
  *
  * @group module_builder
  */
+#[Group('module_builder')]
+#[RunTestsInSeparateProcesses]
 class ComponentFormTest extends BrowserTestBase {
 
   /**
diff --git a/tests/src/Functional/GenerateFormTest.php b/tests/src/Functional/GenerateFormTest.php
index edf643b..b44414f 100644
--- a/tests/src/Functional/GenerateFormTest.php
+++ b/tests/src/Functional/GenerateFormTest.php
@@ -2,6 +2,8 @@
 
 namespace Drupal\Tests\module_builder\Functional;
 
+use PHPUnit\Framework\Attributes\Group;
+use PHPUnit\Framework\Attributes\RunTestsInSeparateProcesses;
 use Drupal\Tests\BrowserTestBase;
 
 /**
@@ -9,6 +11,8 @@ use Drupal\Tests\BrowserTestBase;
  *
  * @group module_builder
  */
+#[Group('module_builder')]
+#[RunTestsInSeparateProcesses]
 class GenerateFormTest extends BrowserTestBase {
 
   /**
diff --git a/tests/src/Unit/ComponentSectionFormHandlerTest.php b/tests/src/Unit/ComponentSectionFormHandlerTest.php
index b38bb43..cb54b28 100644
--- a/tests/src/Unit/ComponentSectionFormHandlerTest.php
+++ b/tests/src/Unit/ComponentSectionFormHandlerTest.php
@@ -2,6 +2,7 @@
 
 namespace Drupal\Tests\module_builder\Unit;
 
+use PHPUnit\Framework\Attributes\Group;
 use Prophecy\PhpUnit\ProphecyTrait;
 use Drupal\Core\Entity\EntityTypeInterface;
 use Drupal\module_builder\EntityHandler\ComponentSectionFormHandler;
@@ -12,6 +13,7 @@ use Drupal\Tests\UnitTestCase;
  *
  * @group module_builder
  */
+#[Group('module_builder')]
 class ComponentSectionFormHandlerTest extends UnitTestCase {
 
   use ProphecyTrait;
