diff --git a/modifiers.info.yml b/modifiers.info.yml
index 2aabdfc..2127ce0 100644
--- a/modifiers.info.yml
+++ b/modifiers.info.yml
@@ -1,5 +1,5 @@
 name: Modifiers
 type: module
 description: Integrates Modifier plugins into the page and into entities.
-core_version_requirement: ^9.5 || ^10 || ^11
+core_version_requirement: ^10.1 || ^11 || ^12
 package: Modifiers
diff --git a/modifiers.module b/modifiers.module
index 5abd837..772e014 100644
--- a/modifiers.module
+++ b/modifiers.module
@@ -5,83 +5,28 @@
  * Modifiers module.
  */
 
+use Drupal\Core\Hook\Attribute\LegacyHook;
+use Drupal\modifiers\Hook\ModifiersHooks;
 use Drupal\Component\Utility\Html;
 use Drupal\Core\Entity\Display\EntityViewDisplayInterface;
 use Drupal\Core\Entity\EntityInterface;
-use Drupal\Core\Entity\FieldableEntityInterface;
 use Drupal\Core\Render\Element;
-use Drupal\modifiers\Modifiers;
 
 /**
  * Implements hook_preprocess_HOOK().
  */
+#[LegacyHook]
 function modifiers_preprocess_html(&$variables) {
 
-  // Attach initialization script for all JS modifications.
-  $variables['#attached']['library'][] = 'modifiers/init';
+  \Drupal::service(ModifiersHooks::class)->preprocessHtml($variables);
 }
 
 /**
  * Implements hook_entity_view_alter().
  */
+#[LegacyHook]
 function modifiers_entity_view_alter(array &$build, EntityInterface $entity, EntityViewDisplayInterface $display) {
-
-  if (!($entity instanceof FieldableEntityInterface) || !$entity->hasField(Modifiers::FIELD)) {
-    return;
-  }
-
-  $entity_type = $entity->getEntityTypeId();
-  $entity_id = Html::getClass($entity_type . '-' . $entity->id());
-  $display_mode = $display->getMode();
-
-  // Skip preview display mode on paragraph entities.
-  if ($entity_type === 'paragraph' && $display_mode === 'preview') {
-    return;
-  }
-
-  // Add common class for all content entities.
-  $build['#attributes']['class'][] = 'modifiers';
-  // Create an unique entity ID class.
-  $build['#attributes']['class'][] = Html::getClass('modifiers-id-' . $entity_id);
-  // Add entity type class.
-  $build['#attributes']['class'][] = Html::getClass('modifiers-type-' . $entity_type);
-  // Add entity bundle class.
-  $build['#attributes']['class'][] = Html::getClass('modifiers-bundle-' . $entity->bundle());
-  // Add entity display mode class.
-  $build['#attributes']['class'][] = Html::getClass('modifiers-display-' . $display_mode);
-
-  // Initialize modifiers service.
-  /** @var \Drupal\modifiers\Modifiers $modifiers */
-  $modifiers = \Drupal::service('modifiers');
-
-  $config = $modifiers->extractEntityConfig($entity, Modifiers::FIELD, ['modifiers' => []]);
-
-  // Allow other modules to alter extracted config.
-  $context = [
-    'build' => $build,
-    'entity' => $entity,
-    'display' => $display,
-  ];
-  \Drupal::moduleHandler()
-    ->alter('modifiers_entity_view_config', $config['modifiers'], $context);
-
-  if (empty($config['modifiers'])) {
-    return;
-  }
-
-  $build['#modifiers'][] = $config['modifiers'];
-
-  // Selector needs to be very specific.
-  $selector = 'html body .modifiers.modifiers-id-' . $entity_id;
-
-  $modifications = [];
-
-  // Fill all modifications.
-  $modifiers->process($modifications, $config['modifiers'], $selector);
-
-  if (!empty($modifications)) {
-    $modifiers->apply($modifications, $build, $entity_id);
-  }
+  \Drupal::service(ModifiersHooks::class)->entityViewAlter($build, $entity, $display);
 }
 
 /**
diff --git a/modifiers.services.yml b/modifiers.services.yml
index 1113592..6594892 100644
--- a/modifiers.services.yml
+++ b/modifiers.services.yml
@@ -7,3 +7,7 @@ services:
     class: \Drupal\modifiers\ModifierPluginManager
     parent: default_plugin_manager
     arguments: ['@theme_handler']
+
+  Drupal\modifiers\Hook\ModifiersHooks:
+    class: Drupal\modifiers\Hook\ModifiersHooks
+    autowire: true
diff --git a/src/Hook/ModifiersHooks.php b/src/Hook/ModifiersHooks.php
new file mode 100644
index 0000000..8a20d38
--- /dev/null
+++ b/src/Hook/ModifiersHooks.php
@@ -0,0 +1,78 @@
+<?php
+
+namespace Drupal\modifiers\Hook;
+
+use Drupal\Component\Utility\Html;
+use Drupal\modifiers\Modifiers;
+use Drupal\Core\Entity\FieldableEntityInterface;
+use Drupal\Core\Entity\Display\EntityViewDisplayInterface;
+use Drupal\Core\Entity\EntityInterface;
+use Drupal\Core\Hook\Attribute\Hook;
+
+/**
+ * Hook implementations for modifiers.
+ */
+class ModifiersHooks {
+
+  /**
+   * Implements hook_preprocess_HOOK().
+   */
+  #[Hook('preprocess_html')]
+  public static function preprocessHtml(&$variables) {
+    // Attach initialization script for all JS modifications.
+    $variables['#attached']['library'][] = 'modifiers/init';
+  }
+
+  /**
+   * Implements hook_entity_view_alter().
+   */
+  #[Hook('entity_view_alter')]
+  public static function entityViewAlter(array &$build, EntityInterface $entity, EntityViewDisplayInterface $display) {
+    if (!$entity instanceof FieldableEntityInterface || !$entity->hasField(Modifiers::FIELD)) {
+      return;
+    }
+    $entity_type = $entity->getEntityTypeId();
+    $entity_id = Html::getClass($entity_type . '-' . $entity->id());
+    $display_mode = $display->getMode();
+    // Skip preview display mode on paragraph entities.
+    if ($entity_type === 'paragraph' && $display_mode === 'preview') {
+      return;
+    }
+    // Add common class for all content entities.
+    $build['#attributes']['class'][] = 'modifiers';
+    // Create an unique entity ID class.
+    $build['#attributes']['class'][] = Html::getClass('modifiers-id-' . $entity_id);
+    // Add entity type class.
+    $build['#attributes']['class'][] = Html::getClass('modifiers-type-' . $entity_type);
+    // Add entity bundle class.
+    $build['#attributes']['class'][] = Html::getClass('modifiers-bundle-' . $entity->bundle());
+    // Add entity display mode class.
+    $build['#attributes']['class'][] = Html::getClass('modifiers-display-' . $display_mode);
+    // Initialize modifiers service.
+    /** @var \Drupal\modifiers\Modifiers $modifiers */
+    $modifiers = \Drupal::service('modifiers');
+    $config = $modifiers->extractEntityConfig($entity, Modifiers::FIELD, [
+      'modifiers' => [],
+    ]);
+    // Allow other modules to alter extracted config.
+    $context = [
+      'build' => $build,
+      'entity' => $entity,
+      'display' => $display,
+    ];
+    \Drupal::moduleHandler()->alter('modifiers_entity_view_config', $config['modifiers'], $context);
+    if (empty($config['modifiers'])) {
+      return;
+    }
+    $build['#modifiers'][] = $config['modifiers'];
+    // Selector needs to be very specific.
+    $selector = 'html body .modifiers.modifiers-id-' . $entity_id;
+    $modifications = [];
+    // Fill all modifications.
+    $modifiers->process($modifications, $config['modifiers'], $selector);
+    if (!empty($modifications)) {
+      $modifiers->apply($modifications, $build, $entity_id);
+    }
+  }
+
+}
diff --git a/tests/src/Unit/ModifiersTest.php b/tests/src/Unit/ModifiersTest.php
index f18909d..d8ffd68 100644
--- a/tests/src/Unit/ModifiersTest.php
+++ b/tests/src/Unit/ModifiersTest.php
@@ -2,6 +2,7 @@
 
 namespace Drupal\Tests\modifiers\Unit;
 
+use PHPUnit\Framework\Attributes\Group;
 use Drupal\modifiers\Modification;
 use Drupal\modifiers\Modifiers;
 use Drupal\Tests\UnitTestCase;
@@ -10,6 +11,7 @@ use Drupal\Tests\UnitTestCase;
  * @coversDefaultClass \Drupal\modifiers\Modifiers
  * @group modifiers
  */
+#[Group('modifiers')]
 class ModifiersTest extends UnitTestCase {
 
   /**
@@ -181,7 +183,6 @@ class ModifiersTest extends UnitTestCase {
    */
   public function testRenderCss() {
     $method = new \ReflectionMethod($this->modifiers, 'renderCss');
-    $method->setAccessible(TRUE);
 
     // Empty array needs to output empty string.
     $actual_1 = $method->invoke($this->modifiers, []);
@@ -220,7 +221,6 @@ class ModifiersTest extends UnitTestCase {
    */
   public function testGetColorValue() {
     $method = new \ReflectionMethod($this->modifiers, 'getColorValue');
-    $method->setAccessible(TRUE);
 
     // Well-formed hexadecimal color.
     $actual_1 = $method->invoke($this->modifiers, 'DB7093', '0.1');
