diff --git a/bem.services.yml b/bem.services.yml
new file mode 100644
index 0000000..1188503
--- /dev/null
+++ b/bem.services.yml
@@ -0,0 +1,5 @@
+
+services:
+  Drupal\bem\Hook\BemHooks:
+    class: Drupal\bem\Hook\BemHooks
+    autowire: true
diff --git a/bem.theme b/bem.theme
index a2ca668..ad11076 100644
--- a/bem.theme
+++ b/bem.theme
@@ -1,5 +1,11 @@
 <?php
 
+/**
+ * @file
+ */
+
+use Drupal\Core\Hook\Attribute\LegacyHook;
+use Drupal\bem\Hook\BemHooks;
 use Drupal\Component\Utility\Html;
 use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Template\Attribute;
@@ -16,17 +22,14 @@ function bem_preprocess_html(array &$variables) {
 /**
  * Implements hook_element_info_alter().
  */
+#[LegacyHook]
 function bem_element_info_alter(array &$types) {
-  foreach ($types as $name => $type) {
-    if (isset($type['#theme_wrappers']) && in_array('form_element', $type['#theme_wrappers'])) {
-      $types[$name]['#process'][] = '_bem_process_form_element';
-    }
-    if (isset($type['#theme_wrappers']) && in_array('details', $type['#theme_wrappers'])) {
-      $types[$name]['#process'][] = '_bem_process_form_element';
-    }
-  }
+  \Drupal::service(BemHooks::class)->elementInfoAlter($types);
 }
 
+/**
+ *
+ */
 function _bem_process_form_element(array &$element, FormStateInterface $form_state, &$complete_form) {
   if (!empty($complete_form['#form_id'])) {
     $element['#bem_form_id'] = $complete_form['#form_id'];
@@ -139,17 +142,7 @@ function bem_preprocess_user(array &$variables) {
  * @see hook_theme_suggestions_HOOK_alter()
  * @see taxonomy_theme_suggestions_taxonomy_term()
  */
+#[LegacyHook]
 function bem_theme_suggestions_taxonomy_term_alter(array &$suggestions, array $variables) {
-  /** @var \Drupal\taxonomy\TermInterface $term */
-  $term = $variables['elements']['#taxonomy_term'];
-  // Insert before taxonomy-term--{bundle}:
-  $bundle_suggestion_pos = array_search('taxonomy_term__' . $term->bundle(), $suggestions);
-  array_splice($suggestions, $bundle_suggestion_pos, 0, [
-    'taxonomy_term__' . $variables['elements']['#view_mode'],
-  ]);
-  // Insert before taxonomy-term--{id}:
-  $id_suggestion_pos = array_search('taxonomy_term__' . $term->id(), $suggestions);
-  array_splice($suggestions, $id_suggestion_pos, 0, [
-    'taxonomy_term__' . $term->bundle() . '__' . $variables['elements']['#view_mode'],
-  ]);
+  \Drupal::service(BemHooks::class)->themeSuggestionsTaxonomyTermAlter($suggestions, $variables);
 }
diff --git a/src/Hook/BemHooks.php b/src/Hook/BemHooks.php
new file mode 100644
index 0000000..7bfa985
--- /dev/null
+++ b/src/Hook/BemHooks.php
@@ -0,0 +1,49 @@
+<?php
+
+namespace Drupal\bem\Hook;
+
+use Drupal\Core\Hook\Attribute\Hook;
+
+/**
+ * Hook implementations for bem.
+ */
+class BemHooks {
+
+  /**
+   * Implements hook_element_info_alter().
+   */
+  #[Hook('element_info_alter')]
+  public function elementInfoAlter(array &$types) {
+    foreach ($types as $name => $type) {
+      if (isset($type['#theme_wrappers']) && in_array('form_element', $type['#theme_wrappers'])) {
+        $types[$name]['#process'][] = '_bem_process_form_element';
+      }
+      if (isset($type['#theme_wrappers']) && in_array('details', $type['#theme_wrappers'])) {
+        $types[$name]['#process'][] = '_bem_process_form_element';
+      }
+    }
+  }
+
+  /**
+   * Implements hook_theme_suggestions_HOOK_alter().
+   *
+   * @see hook_theme_suggestions_HOOK_alter()
+   * @see taxonomy_theme_suggestions_taxonomy_term()
+   */
+  #[Hook('theme_suggestions_taxonomy_term_alter')]
+  public function themeSuggestionsTaxonomyTermAlter(array &$suggestions, array $variables) {
+    /** @var \Drupal\taxonomy\TermInterface $term */
+    $term = $variables['elements']['#taxonomy_term'];
+    // Insert before taxonomy-term--{bundle}:
+    $bundle_suggestion_pos = array_search('taxonomy_term__' . $term->bundle(), $suggestions);
+    array_splice($suggestions, $bundle_suggestion_pos, 0, [
+      'taxonomy_term__' . $variables['elements']['#view_mode'],
+    ]);
+    // Insert before taxonomy-term--{id}:
+    $id_suggestion_pos = array_search('taxonomy_term__' . $term->id(), $suggestions);
+    array_splice($suggestions, $id_suggestion_pos, 0, [
+      'taxonomy_term__' . $term->bundle() . '__' . $variables['elements']['#view_mode'],
+    ]);
+  }
+
+}
