diff --git a/documentation_generator.module b/documentation_generator.module
index 268714b..fc0cb52 100644
--- a/documentation_generator.module
+++ b/documentation_generator.module
@@ -4,53 +4,23 @@
  * @file
  * Defines common functionality for Documentation Generator.
  */
-
+use Drupal\Core\Hook\Attribute\LegacyHook;
+use Drupal\documentation_generator\Hook\DocumentationGeneratorHooks;
 use Symfony\Component\HttpFoundation\BinaryFileResponse;
 
 /**
  * Implements hook_file_download().
  */
-function documentation_generator_file_download($uri) {
-  $stream_wrapper_manager = \Drupal::service('stream_wrapper_manager');
-  $scheme = $stream_wrapper_manager->getScheme($uri);
-  $target = $stream_wrapper_manager->getTarget($uri);
-
-  if (($scheme == 'private')
-    && ($target == 'documentation.docx' || $target == 'documentation.pdf')
-    && ($user = \Drupal::currentUser())
-    && ($user->hasPermission('administer documentation generator'))
-  ) {
-    $uri_download_headers = [
-      'Content-Description' => 'File Transfer',
-      'Content-Disposition' => 'attachment; filename="' . $target . '"',
-      'Content-Type' => \Drupal::service('file.mime_type.guesser')->guessMimeType($uri),
-      'Content-Transfer-Encoding' => 'binary',
-      'Cache-Control' => 'must-revalidate, post-check=0, pre-check=0',
-      'Expires' => 0,
-    ];
-    $file = new BinaryFileResponse($uri, 200, $uri_download_headers, FALSE);
-    $file->send();
-    // Exit to avoid duplication of HTTP transmission.
-    exit();
-
-  }
+#[LegacyHook]
+function documentation_generator_file_download($uri)
+{
+    \Drupal::service(DocumentationGeneratorHooks::class)->fileDownload($uri);
 }
 
 /**
  * Implements hook_theme().
  */
+#[LegacyHook]
 function documentation_generator_theme($existing, $type, $theme, $path) {
-  return [
-    'documentation' => [
-      'variables' => [
-        'title' => NULL,
-        'groups' => [],
-      ],
-    ],
-    'indentation_documentation' => [
-      'variables' => [
-        'size' => 1
-      ],
-    ],
-  ];
+  return \Drupal::service(DocumentationGeneratorHooks::class)->theme($existing, $type, $theme, $path);
 }
diff --git a/documentation_generator.services.yml b/documentation_generator.services.yml
index 58367cf..a26a919 100644
--- a/documentation_generator.services.yml
+++ b/documentation_generator.services.yml
@@ -12,3 +12,7 @@ services:
 
   documentation_generator.dompdf:
     class: Dompdf\Dompdf
+
+  Drupal\documentation_generator\Hook\DocumentationGeneratorHooks:
+    class: Drupal\documentation_generator\Hook\DocumentationGeneratorHooks
+    autowire: true
diff --git a/src/Hook/DocumentationGeneratorHooks.php b/src/Hook/DocumentationGeneratorHooks.php
new file mode 100644
index 0000000..bb5082c
--- /dev/null
+++ b/src/Hook/DocumentationGeneratorHooks.php
@@ -0,0 +1,57 @@
+<?php
+
+namespace Drupal\documentation_generator\Hook;
+
+use Symfony\Component\HttpFoundation\BinaryFileResponse;
+use Drupal\Core\Hook\Attribute\Hook;
+/**
+ * Hook implementations for documentation_generator.
+ */
+class DocumentationGeneratorHooks
+{
+    /**
+     * Implements hook_file_download().
+     */
+    #[Hook('file_download')]
+    public function fileDownload($uri)
+    {
+        $stream_wrapper_manager = \Drupal::service('stream_wrapper_manager');
+        $scheme = $stream_wrapper_manager->getScheme($uri);
+        $target = $stream_wrapper_manager->getTarget($uri);
+        if ($scheme == 'private' && ($target == 'documentation.docx' || $target == 'documentation.pdf') && ($user = \Drupal::currentUser()) && $user->hasPermission('administer documentation generator')) {
+            $uri_download_headers = [
+                'Content-Description' => 'File Transfer',
+                'Content-Disposition' => 'attachment; filename="' . $target . '"',
+                'Content-Type' => \Drupal::service('file.mime_type.guesser')->guessMimeType($uri),
+                'Content-Transfer-Encoding' => 'binary',
+                'Cache-Control' => 'must-revalidate, post-check=0, pre-check=0',
+                'Expires' => 0,
+            ];
+            $file = new \Symfony\Component\HttpFoundation\BinaryFileResponse($uri, 200, $uri_download_headers, FALSE);
+            $file->send();
+            // Exit to avoid duplication of HTTP transmission.
+            exit;
+        }
+    }
+    /**
+     * Implements hook_theme().
+     */
+    #[Hook('theme')]
+    public function theme($existing, $type, $theme, $path)
+    {
+        return [
+            'documentation' => [
+                'variables' => [
+                    'title' => NULL,
+                    'groups' => [
+                    ],
+                ],
+            ],
+            'indentation_documentation' => [
+                'variables' => [
+                    'size' => 1,
+                ],
+            ],
+        ];
+    }
+}
diff --git a/src/Plugin/DocumentationGeneratorChapter/EnabledModules.php b/src/Plugin/DocumentationGeneratorChapter/EnabledModules.php
index 4d9ec95..cca3043 100644
--- a/src/Plugin/DocumentationGeneratorChapter/EnabledModules.php
+++ b/src/Plugin/DocumentationGeneratorChapter/EnabledModules.php
@@ -2,6 +2,7 @@
 
 namespace Drupal\documentation_generator\Plugin\DocumentationGeneratorChapter;
 
+use Drupal\Component\Utility\DeprecationHelper;
 use Drupal\Core\Url;
 use Drupal\documentation_generator\Plugin\DocumentationGeneratorChapterBase;
 
@@ -72,7 +73,7 @@ class EnabledModules extends DocumentationGeneratorChapterBase {
       $elements[] = [
         'type' => 'title',
         'level' => 2,
-        'value' => $this->moduleHandler->getName($module),
+        'value' => DeprecationHelper::backwardsCompatibleCall(\Drupal::VERSION, '10.3.0', fn() => \Drupal::service('extension.list.module')->getName($module), fn() => $this->moduleHandler->getName($module)),
       ];
 
       $elements[] = [
@@ -86,7 +87,7 @@ class EnabledModules extends DocumentationGeneratorChapterBase {
         'level' => 3,
         'value' => $this->t(
             'More about @type at : @parameter', [
-              '@type' => $this->moduleHandler->getName($module),
+              '@type' => DeprecationHelper::backwardsCompatibleCall(\Drupal::VERSION, '10.3.0', fn() => \Drupal::service('extension.list.module')->getName($module), fn() => $this->moduleHandler->getName($module)),
             ]
         )->render(),
         'parameters' => [
diff --git a/src/Plugin/DocumentationGeneratorChapter/Menu.php b/src/Plugin/DocumentationGeneratorChapter/Menu.php
index 415092a..912e623 100644
--- a/src/Plugin/DocumentationGeneratorChapter/Menu.php
+++ b/src/Plugin/DocumentationGeneratorChapter/Menu.php
@@ -2,6 +2,7 @@
 
 namespace Drupal\documentation_generator\Plugin\DocumentationGeneratorChapter;
 
+use Drupal\Component\Utility\DeprecationHelper;
 use Drupal\Core\Url;
 use Drupal\documentation_generator\Plugin\DocumentationGeneratorChapterBase;
 
@@ -83,7 +84,7 @@ class Menu extends DocumentationGeneratorChapterBase {
       $blockMenus[$block->getPluginId()] = $block;
     }
 
-    $regions = system_region_list($defaultThemeName);
+    $regions = DeprecationHelper::backwardsCompatibleCall(\Drupal::VERSION, '11.4.0', fn() => \Drupal::service('theme_handler')->getTheme($defaultThemeName)->listAllRegions(), fn() => system_region_list($defaultThemeName));
 
     foreach ($menus as $menu) {
       $overviewUrl = url::fromUserInput('/admin/structure/menu/manage/' . $menu->id())->setAbsolute()->toString();
diff --git a/tests/src/Functional/GenerateFormTest.php b/tests/src/Functional/GenerateFormTest.php
index b141d75..1b70263 100644
--- a/tests/src/Functional/GenerateFormTest.php
+++ b/tests/src/Functional/GenerateFormTest.php
@@ -2,12 +2,16 @@
 
 namespace Drupal\Tests\documentation_generator\Functional;
 
+use PHPUnit\Framework\Attributes\Group;
+use PHPUnit\Framework\Attributes\RunTestsInSeparateProcesses;
 use Drupal\Tests\BrowserTestBase;
 
 /**
  * @coversDefaultClass \Drupal\documentation_generator\Form\GenerateForm
  * @group documentation_generator
  */
+#[Group('documentation_generator')]
+#[RunTestsInSeparateProcesses]
 class GenerateFormTest extends BrowserTestBase {
 
   /**
diff --git a/tests/src/Unit/Controller/OverviewControllerTest.php b/tests/src/Unit/Controller/OverviewControllerTest.php
index 452a4c9..e08e73d 100644
--- a/tests/src/Unit/Controller/OverviewControllerTest.php
+++ b/tests/src/Unit/Controller/OverviewControllerTest.php
@@ -2,6 +2,7 @@
 
 namespace Drupal\Tests\documentation_generator\Unit\Controller;
 
+use PHPUnit\Framework\Attributes\Group;
 use Drupal\documentation_generator\Controller\OverviewController;
 use Drupal\Tests\UnitTestCase;
 
@@ -9,6 +10,7 @@ use Drupal\Tests\UnitTestCase;
  * @coversDefaultClass \Drupal\documentation_generator\Controller/OverviewViewController
  * @group documentation_generator
  */
+#[Group('documentation_generator')]
 class OverviewControllerTest extends UnitTestCase {
 
   /**
diff --git a/tests/src/Unit/Plugin/DocumentationGeneratorChapter/BlockContentTypeTest.php b/tests/src/Unit/Plugin/DocumentationGeneratorChapter/BlockContentTypeTest.php
index 1c41fc8..c40bae6 100644
--- a/tests/src/Unit/Plugin/DocumentationGeneratorChapter/BlockContentTypeTest.php
+++ b/tests/src/Unit/Plugin/DocumentationGeneratorChapter/BlockContentTypeTest.php
@@ -2,6 +2,7 @@
 
 namespace Drupal\Tests\documentation_generator\Unit\Plugin\DocumentationGeneratorChapter;
 
+use PHPUnit\Framework\Attributes\Group;
 use Drupal\documentation_generator\Plugin\DocumentationGeneratorChapter\BlockContentType;
 use Drupal\Tests\UnitTestCase;
 
@@ -9,6 +10,7 @@ use Drupal\Tests\UnitTestCase;
  * @coversDefaultClass \Drupal\documentation_generator\Plugin\DocumentationGeneratorChapter\BlockContentType
  * @group documentation_generator
  */
+#[Group('documentation_generator')]
 class BlockContentTypeTest extends UnitTestCase {
 
   /**
