diff --git a/src/Hook/WebformFieldsChartHooks.php b/src/Hook/WebformFieldsChartHooks.php
new file mode 100644
index 0000000..e38146e
--- /dev/null
+++ b/src/Hook/WebformFieldsChartHooks.php
@@ -0,0 +1,40 @@
+<?php
+
+namespace Drupal\webform_fields_chart\Hook;
+
+use Drupal\Core\Routing\RouteMatchInterface;
+use Drupal\Core\Hook\Attribute\Hook;
+use Drupal\Core\StringTranslation\StringTranslationTrait;
+/**
+ * Hook implementations for webform_fields_chart.
+ */
+class WebformFieldsChartHooks
+{
+    use StringTranslationTrait;
+    /**
+     * Implements hook_theme().
+     */
+    #[Hook('theme')]
+    public static function theme($existing, $type, $theme, $path): array
+    {
+        return [
+            'webform_fields_chart' => [
+                'variables' => [
+                    'mermaid' => '',
+                ],
+            ],
+        ];
+    }
+    /**
+     * Implements hook_help().
+     */
+    #[Hook('help')]
+    public function help($route_name, \Drupal\Core\Routing\RouteMatchInterface $route_match): ?string
+    {
+        switch ($route_name) {
+            case 'help.page.webform_fields_chart':
+                return '<p>' . $this->t('Visualizes webforms as Mermaid flowchart diagrams.') . '</p>';
+        }
+        return NULL;
+    }
+}
diff --git a/tests/src/Functional/WebformChartControllerTest.php b/tests/src/Functional/WebformChartControllerTest.php
index d0369ea..8ada2ea 100644
--- a/tests/src/Functional/WebformChartControllerTest.php
+++ b/tests/src/Functional/WebformChartControllerTest.php
@@ -4,6 +4,7 @@ declare(strict_types=1);
 
 namespace Drupal\Tests\webform_fields_chart\Functional;
 
+use PHPUnit\Framework\Attributes\RunTestsInSeparateProcesses;
 use Drupal\Tests\BrowserTestBase;
 use Drupal\webform\Entity\Webform;
 use Drupal\webform\WebformInterface;
@@ -11,6 +12,7 @@ use Drupal\webform\WebformInterface;
 /**
  * Tests the webform chart controller endpoints.
  */
+#[RunTestsInSeparateProcesses]
 class WebformChartControllerTest extends BrowserTestBase {
 
   /**
diff --git a/tests/src/Kernel/MermaidRendererTest.php b/tests/src/Kernel/MermaidRendererTest.php
index 1fa49d6..73e9be1 100644
--- a/tests/src/Kernel/MermaidRendererTest.php
+++ b/tests/src/Kernel/MermaidRendererTest.php
@@ -4,12 +4,14 @@ declare(strict_types=1);
 
 namespace Drupal\Tests\webform_fields_chart\Kernel;
 
+use PHPUnit\Framework\Attributes\RunTestsInSeparateProcesses;
 use Drupal\KernelTests\KernelTestBase;
 use Drupal\webform_fields_chart\Service\MermaidRenderer;
 
 /**
  * Tests MermaidRenderer output.
  */
+#[RunTestsInSeparateProcesses]
 class MermaidRendererTest extends KernelTestBase {
 
   /**
diff --git a/webform_fields_chart.module b/webform_fields_chart.module
index e081003..9dc764b 100644
--- a/webform_fields_chart.module
+++ b/webform_fields_chart.module
@@ -4,27 +4,23 @@
  * @file
  * Webform Fields Chart module hooks.
  */
-
+use Drupal\Core\Hook\Attribute\LegacyHook;
+use Drupal\webform_fields_chart\Hook\WebformFieldsChartHooks;
 use Drupal\Core\Routing\RouteMatchInterface;
 
 /**
  * Implements hook_theme().
  */
+#[LegacyHook]
 function webform_fields_chart_theme($existing, $type, $theme, $path): array {
-  return [
-    'webform_fields_chart' => [
-      'variables' => ['mermaid' => ''],
-    ],
-  ];
+  return \Drupal::service(WebformFieldsChartHooks::class)->theme($existing, $type, $theme, $path);
 }
 
 /**
  * Implements hook_help().
  */
-function webform_fields_chart_help($route_name, RouteMatchInterface $route_match): ?string {
-  switch ($route_name) {
-    case 'help.page.webform_fields_chart':
-      return '<p>' . t('Visualizes webforms as Mermaid flowchart diagrams.') . '</p>';
-  }
-  return NULL;
+#[LegacyHook]
+function webform_fields_chart_help($route_name, RouteMatchInterface $route_match): ?string
+{
+    return \Drupal::service(WebformFieldsChartHooks::class)->help($route_name, $route_match);
 }
diff --git a/webform_fields_chart.services.yml b/webform_fields_chart.services.yml
index e8dd0a5..c672e6e 100644
--- a/webform_fields_chart.services.yml
+++ b/webform_fields_chart.services.yml
@@ -13,3 +13,7 @@ services:
       - '@webform_conditions.dependency_mapper'
       - '@webform_fields_chart.mermaid_renderer'
     public: true
+
+  Drupal\webform_fields_chart\Hook\WebformFieldsChartHooks:
+    class: Drupal\webform_fields_chart\Hook\WebformFieldsChartHooks
+    autowire: true
