diff --git a/optimizely.module b/optimizely.module
index b62b57b..4fb34d9 100644
--- a/optimizely.module
+++ b/optimizely.module
@@ -25,7 +25,8 @@
  *
  * 8.x-dev by Earl Fong (tz_earl: https://www.drupal.org/user/2531114/)
  */
-
+use Drupal\Core\Hook\Attribute\LegacyHook;
+use Drupal\optimizely\Hook\OptimizelyHooks;
 use Drupal\Core\Url;
 
 /**
@@ -33,51 +34,10 @@
  *
  * Help text related to the module's functionality and use.
  */
+#[LegacyHook]
 function optimizely_help($route_name, $arg) {
 
-  switch ($route_name) {
-
-    case 'help.page.optimizely':
-      return t('<p><a href="http://optimize.ly/OZRdc0">Optimizely</a> is a third
-         party service to add A/B testing to a web site. The tests are applied to
-         the site by loading javascript snippets generated by the Optimizely web
-         site. The generated javascript files are applied to certain paths on the
-         site based on Project entries managed by the Optimizely module. To start
-         to apply the general, sitewide Optimizely javascript file the
-         <a href="@settings">Optimizely account ID</a> must be entered in the
-         module administration page.</p>
-         <p>Enable or disable each project entry to apply the project settings
-         while not needing to remove the actual entry. The default entry can be
-         disabled when additional project entries are made with more specific
-         settings. This can include using the orginal Project Code.</p>',
-        ['@settings' => Url::fromRoute('optimizely.settings')->toString()]);
-
-    case 'entity.optimizely.collection':
-      return t('<p>A listing of the Optimizely projects. Each entry can be
-         enabled / disabled for specific or wildcard paths. Enabled entries are
-         highlighted in green while disabled entries are in red. The top,
-         "Default" entry cannot be deleted but its settings can be adjusted or
-         completely disabled.</p>
-         <p>The goal of having multiple projects is to minimize the size of the
-         optimizely hosted javascript file. If all experiments are contained in a
-         single file and processed on every page load there may be an issue with
-         increased page load time. Having multiple projects and loading them on
-         specific paths that apply to the experiments helps to minimize the size
-         of the file and eliminate processing unused javascript on the user\'s
-         browser.</p>');
-
-    case 'entity.optimizely.add_form':
-    case 'entity.optimizely.edit_form':
-      return t('Add or edit specific project entries. Each entry should have an
-         Optimizely project / experiment assigned to it, as well as a range of
-         website paths where the Optimizely javascript hosted file should be
-         included.');
-
-    case 'optimizely.settings':
-      return t('Add the Optimizely account ID supplied by the Optimizely website.
-         The account ID is essential to setting up the initial sitewide default
-         project entry.');
-  }
+  return \Drupal::service(OptimizelyHooks::class)->help($route_name, $arg);
 }
 
 /**
@@ -86,140 +46,10 @@ function optimizely_help($route_name, $arg) {
  * Checks each page that is about to be rendered as to
  * whether to insert a snippet of Optimizely code or not.
  */
-function optimizely_page_attachments(array &$page) {
-
-  $url = Url::fromRoute('<current>');
-  $current_path = $url->getInternalPath();
-  $current_path = optimizely_check_path($current_path);
-
-  $current_path_alias = optimizely_lookup_path_alias($current_path);
-
-  $add_snippet = FALSE;
-
-  // Load all entries from optimizely config.
-  $projects = \Drupal::entityTypeManager()
-    ->getStorage('optimizely')
-    ->loadByProperties(['state' => TRUE]);
-
-  if (!$projects) {
-    return;
-  }
-
-  // Query results found.
-  $cache_tag = NULL;
-
-  // Loop through each row of the found results.
-  foreach ($projects as $project) {
-
-    // Only process the entries that are enabled.
-    if (!$project->getState()) {
-      continue;
-    }
-
-    // Target paths from database for project.
-    $project_paths = explode("\r\n", $project->getPaths());
-
-    // Remember to check all paths for alias or sytem URL values.
-    foreach ($project_paths as $proj_path) {
-
-      // If the Optimizely snippet is added, use the project's path as one
-      // of the cache tags for this page. Cache invalidation is triggered
-      // via cache tags when project paths are modified or deleted. Spaces
-      // are not allowed in cache_tags, but all other characters seem to be
-      // allowed, including *. See class CacheRefresher which does the
-      // qinvalidating.
-      $cache_tag = 'optimizely:' . $proj_path;
-
-      // Remove parameters, if any.
-      if (strpos($proj_path, '?') !== FALSE) {
-        $proj_path = substr($proj_path, 0, strpos($proj_path, '?'));
-      }
-
-      // Look for sitewide wild card.
-      if ($proj_path == '*') {
-        $add_snippet = TRUE;
-        break 2;
-      }
-
-      // Look for wildcard match that is not sitewide.
-      if (strpos($proj_path, '*') !== FALSE) {
-
-        // Remove wildcard, get base path(s)
-        $proj_path = substr($proj_path, 0, -2);
-
-        // Look for wildcard match.
-        if (stripos($current_path, $proj_path) === 0 ||
-               stripos(optimizely_lookup_path_alias($current_path), $proj_path) === 0 ||
-               stripos(optimizely_lookup_system_path($current_path), $proj_path) === 0) {
-          $add_snippet = TRUE;
-          break 2;
-        }
-      }
-
-      // Build a string containing as many as three possible variants
-      // of $proj_path.
-      $paths_to_check = $proj_path;
-
-      $proj_path_source = optimizely_lookup_system_path($proj_path);
-      if ($proj_path_source) {
-        $paths_to_check .= "\n" . $proj_path_source;
-      }
-
-      $proj_path_alias = optimizely_lookup_path_alias($proj_path);
-      if ($proj_path_alias) {
-        $paths_to_check .= "\n" . $proj_path_alias;
-      }
-
-      // See if there is a match against any variant of $proj_path.
-      if (\Drupal::service('path.matcher')->matchPath($current_path, $paths_to_check) ||
-          \Drupal::service('path.matcher')->matchPath($current_path_alias, $paths_to_check)) {
-        $add_snippet = TRUE;
-        break 2;
-      }
-
-    }
-
-  }
-
-  if ($add_snippet) {
-
-    // Add javascript call to page markup.
-    $snippet_url = '//cdn.optimizely.com/js/' . $project->getCode() . '.js';
-    $page['#attached']['html_head'][] = [
-      [
-        '#tag' => 'script',
-        '#attributes' => [
-          'type' => 'text/javascript',
-          'src' => $snippet_url,
-        ],
-        '#value' => '',
-      ],
-      'optimizely-snippet',
-    ];
-
-    $page['#cache']['tags'][] = $cache_tag;
-  }
-
-  // For every page, add all other cache tags that might possibly cause it
-  // to be invalidated.
-
-  // Site-wide wildcard.
-  $page['#cache']['tags'][] = 'optimizely:*';
-
-  // Non site-wide wildcards. Repeat for every directory level.
-  $dirname = pathinfo($current_path, PATHINFO_DIRNAME);
-  while ($dirname && $dirname != '/' && $dirname != '\\') {
-    $page['#cache']['tags'][] = 'optimizely:' . $dirname . '/*';
-    $dirname = pathinfo($dirname, PATHINFO_DIRNAME);
-  }
-
-  // The specific page url.
-  $page['#cache']['tags'][] = 'optimizely:' . $current_path;
-
-  // Finally, if there is an alias for the page, tag it.
-  if ($current_path_alias) {
-    $page['#cache']['tags'][] = 'optimizely:' . $current_path_alias;
-  }
+#[LegacyHook]
+function optimizely_page_attachments(array &$page)
+{
+    \Drupal::service(OptimizelyHooks::class)->pageAttachments($page);
 }
 
 // The following three functions are redundant with and copied verbatim
diff --git a/optimizely.services.yml b/optimizely.services.yml
index c1b939f..9a79dd1 100644
--- a/optimizely.services.yml
+++ b/optimizely.services.yml
@@ -10,3 +10,7 @@ services:
     arguments:
       - '@language_manager'
       - '@path_alias.manager'
+
+  Drupal\optimizely\Hook\OptimizelyHooks:
+    class: Drupal\optimizely\Hook\OptimizelyHooks
+    autowire: true
diff --git a/src/Hook/OptimizelyHooks.php b/src/Hook/OptimizelyHooks.php
new file mode 100644
index 0000000..73f9de7
--- /dev/null
+++ b/src/Hook/OptimizelyHooks.php
@@ -0,0 +1,173 @@
+<?php
+
+namespace Drupal\optimizely\Hook;
+
+use Drupal\Core\Url;
+use Drupal\Core\Hook\Attribute\Hook;
+use Drupal\Core\StringTranslation\StringTranslationTrait;
+/**
+ * Hook implementations for optimizely.
+ */
+class OptimizelyHooks
+{
+    use StringTranslationTrait;
+    /**
+     * Implements hook_help().
+     *
+     * Help text related to the module's functionality and use.
+     */
+    #[Hook('help')]
+    public function help($route_name, $arg)
+    {
+        switch ($route_name) {
+            case 'help.page.optimizely':
+                return $this->t('<p><a href="http://optimize.ly/OZRdc0">Optimizely</a> is a third
+         party service to add A/B testing to a web site. The tests are applied to
+         the site by loading javascript snippets generated by the Optimizely web
+         site. The generated javascript files are applied to certain paths on the
+         site based on Project entries managed by the Optimizely module. To start
+         to apply the general, sitewide Optimizely javascript file the
+         <a href="@settings">Optimizely account ID</a> must be entered in the
+         module administration page.</p>
+         <p>Enable or disable each project entry to apply the project settings
+         while not needing to remove the actual entry. The default entry can be
+         disabled when additional project entries are made with more specific
+         settings. This can include using the orginal Project Code.</p>', [
+                    '@settings' => \Drupal\Core\Url::fromRoute('optimizely.settings')->toString(),
+                ]);
+            case 'entity.optimizely.collection':
+                return $this->t('<p>A listing of the Optimizely projects. Each entry can be
+         enabled / disabled for specific or wildcard paths. Enabled entries are
+         highlighted in green while disabled entries are in red. The top,
+         "Default" entry cannot be deleted but its settings can be adjusted or
+         completely disabled.</p>
+         <p>The goal of having multiple projects is to minimize the size of the
+         optimizely hosted javascript file. If all experiments are contained in a
+         single file and processed on every page load there may be an issue with
+         increased page load time. Having multiple projects and loading them on
+         specific paths that apply to the experiments helps to minimize the size
+         of the file and eliminate processing unused javascript on the user\'s
+         browser.</p>');
+            case 'entity.optimizely.add_form':
+            case 'entity.optimizely.edit_form':
+                return $this->t('Add or edit specific project entries. Each entry should have an
+         Optimizely project / experiment assigned to it, as well as a range of
+         website paths where the Optimizely javascript hosted file should be
+         included.');
+            case 'optimizely.settings':
+                return $this->t('Add the Optimizely account ID supplied by the Optimizely website.
+         The account ID is essential to setting up the initial sitewide default
+         project entry.');
+        }
+    }
+    /**
+     * Implements hook_page_attachments().
+     *
+     * Checks each page that is about to be rendered as to
+     * whether to insert a snippet of Optimizely code or not.
+     */
+    #[Hook('page_attachments')]
+    public static function pageAttachments(array &$page)
+    {
+        $url = \Drupal\Core\Url::fromRoute('<current>');
+        $current_path = $url->getInternalPath();
+        $current_path = optimizely_check_path($current_path);
+        $current_path_alias = optimizely_lookup_path_alias($current_path);
+        $add_snippet = FALSE;
+        // Load all entries from optimizely config.
+        $projects = \Drupal::entityTypeManager()->getStorage('optimizely')->loadByProperties([
+            'state' => TRUE,
+        ]);
+        if (!$projects) {
+            return;
+        }
+        // Query results found.
+        $cache_tag = NULL;
+        // Loop through each row of the found results.
+        foreach ($projects as $project) {
+            // Only process the entries that are enabled.
+            if (!$project->getState()) {
+                continue;
+            }
+            // Target paths from database for project.
+            $project_paths = explode("\r\n", $project->getPaths());
+            // Remember to check all paths for alias or sytem URL values.
+            foreach ($project_paths as $proj_path) {
+                // If the Optimizely snippet is added, use the project's path as one
+                // of the cache tags for this page. Cache invalidation is triggered
+                // via cache tags when project paths are modified or deleted. Spaces
+                // are not allowed in cache_tags, but all other characters seem to be
+                // allowed, including *. See class CacheRefresher which does the
+                // qinvalidating.
+                $cache_tag = 'optimizely:' . $proj_path;
+                // Remove parameters, if any.
+                if (strpos($proj_path, '?') !== FALSE) {
+                    $proj_path = substr($proj_path, 0, strpos($proj_path, '?'));
+                }
+                // Look for sitewide wild card.
+                if ($proj_path == '*') {
+                    $add_snippet = TRUE;
+                    break 2;
+                }
+                // Look for wildcard match that is not sitewide.
+                if (strpos($proj_path, '*') !== FALSE) {
+                    // Remove wildcard, get base path(s)
+                    $proj_path = substr($proj_path, 0, -2);
+                    // Look for wildcard match.
+                    if (stripos($current_path, $proj_path) === 0 || stripos(optimizely_lookup_path_alias($current_path), $proj_path) === 0 || stripos(optimizely_lookup_system_path($current_path), $proj_path) === 0) {
+                        $add_snippet = TRUE;
+                        break 2;
+                    }
+                }
+                // Build a string containing as many as three possible variants
+                // of $proj_path.
+                $paths_to_check = $proj_path;
+                $proj_path_source = optimizely_lookup_system_path($proj_path);
+                if ($proj_path_source) {
+                    $paths_to_check .= "\n" . $proj_path_source;
+                }
+                $proj_path_alias = optimizely_lookup_path_alias($proj_path);
+                if ($proj_path_alias) {
+                    $paths_to_check .= "\n" . $proj_path_alias;
+                }
+                // See if there is a match against any variant of $proj_path.
+                if (\Drupal::service('path.matcher')->matchPath($current_path, $paths_to_check) || \Drupal::service('path.matcher')->matchPath($current_path_alias, $paths_to_check)) {
+                    $add_snippet = TRUE;
+                    break 2;
+                }
+            }
+        }
+        if ($add_snippet) {
+            // Add javascript call to page markup.
+            $snippet_url = '//cdn.optimizely.com/js/' . $project->getCode() . '.js';
+            $page['#attached']['html_head'][] = [
+                [
+                    '#tag' => 'script',
+                    '#attributes' => [
+                        'type' => 'text/javascript',
+                        'src' => $snippet_url,
+                    ],
+                    '#value' => '',
+                ],
+                'optimizely-snippet',
+            ];
+            $page['#cache']['tags'][] = $cache_tag;
+        }
+        // For every page, add all other cache tags that might possibly cause it
+        // to be invalidated.
+        // Site-wide wildcard.
+        $page['#cache']['tags'][] = 'optimizely:*';
+        // Non site-wide wildcards. Repeat for every directory level.
+        $dirname = pathinfo($current_path, PATHINFO_DIRNAME);
+        while ($dirname && $dirname != '/' && $dirname != '\\') {
+            $page['#cache']['tags'][] = 'optimizely:' . $dirname . '/*';
+            $dirname = pathinfo($dirname, PATHINFO_DIRNAME);
+        }
+        // The specific page url.
+        $page['#cache']['tags'][] = 'optimizely:' . $current_path;
+        // Finally, if there is an alias for the page, tag it.
+        if ($current_path_alias) {
+            $page['#cache']['tags'][] = 'optimizely:' . $current_path_alias;
+        }
+    }
+}
diff --git a/src/Util/CacheRefresher.php b/src/Util/CacheRefresher.php
index 8a670b0..5d93426 100644
--- a/src/Util/CacheRefresher.php
+++ b/src/Util/CacheRefresher.php
@@ -25,7 +25,7 @@ class CacheRefresher {
    *   If a set of paths is being changed, this will be the original set.
    */
   public function doRefresh(array $path_array,
-    array $original_path_array = NULL) {
+    ?array $original_path_array = NULL) {
 
     // If there are project edits that include changes to the path,
     // clear cache on all paths/tags to add or remove Optimizely
diff --git a/tests/src/Functional/OptimizelyAccessTest.php b/tests/src/Functional/OptimizelyAccessTest.php
index e098c5f..38d802d 100644
--- a/tests/src/Functional/OptimizelyAccessTest.php
+++ b/tests/src/Functional/OptimizelyAccessTest.php
@@ -2,6 +2,8 @@
 
 namespace Drupal\Tests\optimizely\Functional;
 
+use PHPUnit\Framework\Attributes\Group;
+use PHPUnit\Framework\Attributes\RunTestsInSeparateProcesses;
 use Drupal\Tests\BrowserTestBase;
 
 /**
@@ -11,6 +13,8 @@
  *
  * @group Optimizely
  */
+#[Group('Optimizely')]
+#[RunTestsInSeparateProcesses]
 class OptimizelyAccessTest extends BrowserTestBase {
 
   /**
diff --git a/tests/src/Functional/OptimizelyAddUpdateTest.php b/tests/src/Functional/OptimizelyAddUpdateTest.php
index ef07220..fe5ae21 100644
--- a/tests/src/Functional/OptimizelyAddUpdateTest.php
+++ b/tests/src/Functional/OptimizelyAddUpdateTest.php
@@ -2,6 +2,10 @@
 
 namespace Drupal\Tests\optimizely\Functional;
 
+use PHPUnit\Framework\Attributes\Group;
+use PHPUnit\Framework\Attributes\RunTestsInSeparateProcesses;
+use Drupal\Component\Utility\DeprecationHelper;
+use Drupal\filter\FilterFormatRepositoryInterface;
 use Drupal\Core\Language\LanguageInterface;
 use Drupal\Tests\BrowserTestBase;
 
@@ -10,6 +14,8 @@
  *
  * @group Optimizely
  */
+#[Group('Optimizely')]
+#[RunTestsInSeparateProcesses]
 class OptimizelyAddUpdateTest extends BrowserTestBase {
 
   /**
@@ -114,7 +120,7 @@ public function testAddUpdateProject() {
       'body' => [
                   [
                     'value' => $this->randomMachineName(64),
-                    'format' => filter_default_format(),
+                    'format' => DeprecationHelper::backwardsCompatibleCall(\Drupal::VERSION, '11.4.0', fn() => \Drupal::service(FilterFormatRepositoryInterface::class)->getDefaultFormat()->id(), fn() => filter_default_format()),
                   ],
       ],
     ];
@@ -153,7 +159,7 @@ public function testAddUpdateProject() {
       'body' => [
                   [
                     'value' => $this->randomMachineName(64),
-                    'format' => filter_default_format(),
+                    'format' => DeprecationHelper::backwardsCompatibleCall(\Drupal::VERSION, '11.4.0', fn() => \Drupal::service(FilterFormatRepositoryInterface::class)->getDefaultFormat()->id(), fn() => filter_default_format()),
                   ],
       ],
     ];
diff --git a/tests/src/Functional/OptimizelyAliasIncludeSnippetTest.php b/tests/src/Functional/OptimizelyAliasIncludeSnippetTest.php
index ea77c57..a372e56 100644
--- a/tests/src/Functional/OptimizelyAliasIncludeSnippetTest.php
+++ b/tests/src/Functional/OptimizelyAliasIncludeSnippetTest.php
@@ -2,6 +2,10 @@
 
 namespace Drupal\Tests\optimizely\Functional;
 
+use PHPUnit\Framework\Attributes\Group;
+use PHPUnit\Framework\Attributes\RunTestsInSeparateProcesses;
+use Drupal\Component\Utility\DeprecationHelper;
+use Drupal\filter\FilterFormatRepositoryInterface;
 use Drupal\Core\Language\LanguageInterface;
 use Drupal\Tests\BrowserTestBase;
 
@@ -13,6 +17,8 @@
  *
  * @group Optimizely
  */
+#[Group('Optimizely')]
+#[RunTestsInSeparateProcesses]
 class OptimizelyAliasIncludeSnippetTest extends BrowserTestBase {
 
   /**
@@ -152,7 +158,7 @@ private function makePage() {
       'body' => [
                   [
                     'value' => $this->randomMachineName(64),
-                    'format' => filter_default_format(),
+                    'format' => DeprecationHelper::backwardsCompatibleCall(\Drupal::VERSION, '11.4.0', fn() => \Drupal::service(FilterFormatRepositoryInterface::class)->getDefaultFormat()->id(), fn() => filter_default_format()),
                   ],
       ],
     ];
diff --git a/tests/src/Functional/OptimizelyDefaultProjectTest.php b/tests/src/Functional/OptimizelyDefaultProjectTest.php
index dfb8529..c49b4a1 100644
--- a/tests/src/Functional/OptimizelyDefaultProjectTest.php
+++ b/tests/src/Functional/OptimizelyDefaultProjectTest.php
@@ -2,6 +2,8 @@
 
 namespace Drupal\Tests\optimizely\Functional;
 
+use PHPUnit\Framework\Attributes\Group;
+use PHPUnit\Framework\Attributes\RunTestsInSeparateProcesses;
 use Drupal\Tests\BrowserTestBase;
 
 /**
@@ -29,6 +31,8 @@
  *
  * @group Optimizely
  */
+#[Group('Optimizely')]
+#[RunTestsInSeparateProcesses]
 class OptimizelyDefaultProjectTest extends BrowserTestBase {
 
   /**
diff --git a/tests/src/Functional/OptimizelyDefaultSettingsTest.php b/tests/src/Functional/OptimizelyDefaultSettingsTest.php
index 20fd463..0c95727 100644
--- a/tests/src/Functional/OptimizelyDefaultSettingsTest.php
+++ b/tests/src/Functional/OptimizelyDefaultSettingsTest.php
@@ -2,6 +2,8 @@
 
 namespace Drupal\Tests\optimizely\Functional;
 
+use PHPUnit\Framework\Attributes\Group;
+use PHPUnit\Framework\Attributes\RunTestsInSeparateProcesses;
 use Drupal\Tests\BrowserTestBase;
 
 /**
@@ -9,6 +11,8 @@
  *
  * @group Optimizely
  */
+#[Group('Optimizely')]
+#[RunTestsInSeparateProcesses]
 class OptimizelyDefaultSettingsTest extends BrowserTestBase {
 
   /**
diff --git a/tests/src/Functional/OptimizelyEnableDisableTest.php b/tests/src/Functional/OptimizelyEnableDisableTest.php
index c0c04e8..a9c25e3 100644
--- a/tests/src/Functional/OptimizelyEnableDisableTest.php
+++ b/tests/src/Functional/OptimizelyEnableDisableTest.php
@@ -2,6 +2,10 @@
 
 namespace Drupal\Tests\optimizely\Functional;
 
+use PHPUnit\Framework\Attributes\Group;
+use PHPUnit\Framework\Attributes\RunTestsInSeparateProcesses;
+use Drupal\Component\Utility\DeprecationHelper;
+use Drupal\filter\FilterFormatRepositoryInterface;
 use Drupal\Core\Language\LanguageInterface;
 use Drupal\Tests\BrowserTestBase;
 
@@ -10,6 +14,8 @@
  *
  * @group Optimizely
  */
+#[Group('Optimizely')]
+#[RunTestsInSeparateProcesses]
 class OptimizelyEnableDisableTest extends BrowserTestBase {
 
   /**
@@ -103,7 +109,7 @@ public function testEnableDisable() {
       'body' => [
                   [
                     'value' => $this->randomMachineName(64),
-                    'format' => filter_default_format(),
+                    'format' => DeprecationHelper::backwardsCompatibleCall(\Drupal::VERSION, '11.4.0', fn() => \Drupal::service(FilterFormatRepositoryInterface::class)->getDefaultFormat()->id(), fn() => filter_default_format()),
                   ],
       ],
     ];
diff --git a/tests/src/Functional/OptimizelyIncludeSnippetTest.php b/tests/src/Functional/OptimizelyIncludeSnippetTest.php
index 7499392..c75543c 100644
--- a/tests/src/Functional/OptimizelyIncludeSnippetTest.php
+++ b/tests/src/Functional/OptimizelyIncludeSnippetTest.php
@@ -2,6 +2,10 @@
 
 namespace Drupal\Tests\optimizely\Functional;
 
+use PHPUnit\Framework\Attributes\Group;
+use PHPUnit\Framework\Attributes\RunTestsInSeparateProcesses;
+use Drupal\Component\Utility\DeprecationHelper;
+use Drupal\filter\FilterFormatRepositoryInterface;
 use Drupal\Core\Language\LanguageInterface;
 use Drupal\Tests\BrowserTestBase;
 
@@ -12,6 +16,8 @@
  *
  * @group Optimizely
  */
+#[Group('Optimizely')]
+#[RunTestsInSeparateProcesses]
 class OptimizelyIncludeSnippetTest extends BrowserTestBase {
 
   /**
@@ -138,7 +144,7 @@ private function makePage() {
       'body' => [
                   [
                     'value' => $this->randomMachineName(64),
-                    'format' => filter_default_format(),
+                    'format' => DeprecationHelper::backwardsCompatibleCall(\Drupal::VERSION, '11.4.0', fn() => \Drupal::service(FilterFormatRepositoryInterface::class)->getDefaultFormat()->id(), fn() => filter_default_format()),
                   ],
       ],
     ];
diff --git a/tests/src/Functional/OptimizelyPageSnippetTest.php b/tests/src/Functional/OptimizelyPageSnippetTest.php
index ba35c00..ca72693 100644
--- a/tests/src/Functional/OptimizelyPageSnippetTest.php
+++ b/tests/src/Functional/OptimizelyPageSnippetTest.php
@@ -2,6 +2,10 @@
 
 namespace Drupal\Tests\optimizely\Functional;
 
+use PHPUnit\Framework\Attributes\Group;
+use PHPUnit\Framework\Attributes\RunTestsInSeparateProcesses;
+use Drupal\Component\Utility\DeprecationHelper;
+use Drupal\filter\FilterFormatRepositoryInterface;
 use Drupal\Tests\BrowserTestBase;
 use Drupal\Core\Language\LanguageInterface;
 
@@ -10,6 +14,8 @@
  *
  * @group Optimizely
  */
+#[Group('Optimizely')]
+#[RunTestsInSeparateProcesses]
 class OptimizelyPageSnippetTest extends BrowserTestBase {
 
   /**
@@ -191,7 +197,7 @@ public function setUp(): void {
           'body' => [
                       [
                         'value' => $this->randomMachineName(64),
-                        'format' => filter_default_format(),
+                        'format' => DeprecationHelper::backwardsCompatibleCall(\Drupal::VERSION, '11.4.0', fn() => \Drupal::service(FilterFormatRepositoryInterface::class)->getDefaultFormat()->id(), fn() => filter_default_format()),
                       ],
           ],
         ];
