diff --git a/module_usage.info.yml b/module_usage.info.yml
index a24c2b7..37f2bd9 100644
--- a/module_usage.info.yml
+++ b/module_usage.info.yml
@@ -2,7 +2,7 @@ name: 'Module usage'
 type: module
 description: 'Document how/why/where modules are used.'
 package: 'Documentation'
-core_version_requirement: ^10 || ^11
+core_version_requirement: ^10.1 || ^11 || ^12
 dependencies:
   - jquery_ui_accordion
 version: 1.1.1
diff --git a/module_usage.install b/module_usage.install
index f4cede3..8949b6b 100644
--- a/module_usage.install
+++ b/module_usage.install
@@ -1,5 +1,6 @@
 <?php
 
+use Drupal\module_usage\Services\QueryService;
 use Drupal\paragraphs\Entity\ParagraphsType;
 
 const VERSION = '1.0.0@alpha1';
@@ -237,7 +238,7 @@ function module_usage_schema() : array {
  */
 function module_usage_update_10001(&$sandbox) {
   $connection = \Drupal::database();
-  $cnt = $connection->update(\Drupal\module_usage\Services\QueryService::ACTIVITY_TABLE)
+  $cnt = $connection->update(QueryService::ACTIVITY_TABLE)
     ->fields([
       'event_description' => 'Version changed from unknown',
     ])
diff --git a/module_usage.module b/module_usage.module
index 97af7d7..6899f24 100644
--- a/module_usage.module
+++ b/module_usage.module
@@ -4,7 +4,8 @@
  * @file
  * Hook implementations.
  */
-
+use Drupal\Core\Hook\Attribute\LegacyHook;
+use Drupal\module_usage\Hook\ModuleUsageHooks;
 use Drupal\Core\Form\FormStateInterface;
 
 const MODULE_USAGE_ULTIMATE_CRON_KEY = 'ultimate_cron_running';
@@ -12,228 +13,109 @@ const MODULE_USAGE_ULTIMATE_CRON_KEY = 'ultimate_cron_running';
 /**
  * Implements hook_preprocess_HOOK().
  */
+#[LegacyHook]
 function module_usage_preprocess_system_modules_details__custom(&$variables) : void {
-  $variables['#attached']['library'][] = 'module_usage/module_usage';
+  \Drupal::service(ModuleUsageHooks::class)->preprocessSystemModulesDetailsCustom($variables);
 }
 
 /**
  * Implements hook_preprocess_HOOK().
  */
+#[LegacyHook]
 function module_usage_preprocess_system_modules_details__custom_filter(&$variables) : void {
-  $variables['#attached']['library'][] = 'module_usage/module_usage';
+  \Drupal::service(ModuleUsageHooks::class)->preprocessSystemModulesDetailsCustomFilter($variables);
 }
 
 /**
  * Implements hook_preprocess_HOOK().
  */
+#[LegacyHook]
 function module_usage_preprocess_system_modules_uninstall__custom(&$variables) : void {
-  $variables['#attached']['library'][] = 'module_usage/module_usage';
+  \Drupal::service(ModuleUsageHooks::class)->preprocessSystemModulesUninstallCustom($variables);
 }
 
 /**
  * Implements hook_preprocess_HOOK().
  */
+#[LegacyHook]
 function module_usage_preprocess_update_project_status__custom(&$variables) : void {
-  $variables['#attached']['library'][] = 'module_usage/module_usage';
+  \Drupal::service(ModuleUsageHooks::class)->preprocessUpdateProjectStatusCustom($variables);
 }
 
 /**
  * Implements hook_theme_suggestions_HOOK_alter().
  */
+#[LegacyHook]
 function module_usage_theme_suggestions_system_modules_details_alter(array &$suggestions, array $variables) : void {
-  // Add a new suggestion that is more specific than the theme's.
-  if (\Drupal::moduleHandler()->moduleExists('module_filter')) {
-    $suggestions[] = 'system_modules_details__custom_filter';
-  }
-  else {
-    $suggestions[] = 'system_modules_details__custom';
-  }
+  \Drupal::service(ModuleUsageHooks::class)->themeSuggestionsSystemModulesDetailsAlter($suggestions, $variables);
 }
 
 /**
  * Implements hook_theme_suggestions_HOOK_alter().
  */
+#[LegacyHook]
 function module_usage_theme_suggestions_system_modules_uninstall_alter(array &$suggestions, array $variables) : void {
-  $suggestions[] = 'system_modules_uninstall__custom';
+  \Drupal::service(ModuleUsageHooks::class)->themeSuggestionsSystemModulesUninstallAlter($suggestions, $variables);
 }
 
 /**
  * Implements hook_theme_suggestions_HOOK_alter().
  */
+#[LegacyHook]
 function module_usage_theme_suggestions_update_project_status_alter(array &$suggestions, array $variables) : void {
-  $suggestions[] = 'update_project_status__custom';
+  \Drupal::service(ModuleUsageHooks::class)->themeSuggestionsUpdateProjectStatusAlter($suggestions, $variables);
 }
 
 /**
  * Implements hook_theme().
  */
-function module_usage_theme($existing, $type, $theme, $path) : array {
-  $extensionResolver = Drupal::service('extension.path.resolver');
-  $module_path = $extensionResolver->getPath('module', 'module_usage');
-
-  return [
-
-    'module_usage_view' => [
-      'variables' => [
-        'item' => NULL,
-        'activity' => NULL,
-        'notes' => NULL,
-        'urls' => NULL,
-        'description' => NULL,
-      ],
-    ],
-
-    'module_accordion' => [
-      'variables' => [
-        'item' => NULL,
-        'activity' => NULL,
-        'notes' => NULL,
-        'urls' => NULL,
-        'description' => NULL,
-      ],
-    ],
-    'module_usage__description' => [
-      'variables' => [
-        'machine_name' => NULL,
-        'description' => NULL,
-        'description_last_updated' => NULL,
-      ],
-    ],
-    'module_usage__urls' => [
-      'variables' => [
-        'urls' => NULL,
-        'machine_name' => NULL,
-        'attributes' => NULL,
-      ],
-    ],
-    'module_usage__notes' => [
-      'variables' => [
-        'notes' => NULL,
-        'attributes' => NULL,
-        'machine_name' => NULL,
-      ],
-    ],
-    'system_modules_uninstall__custom' => [
-      'render element' => 'form',
-      'base hook' => 'system_modules_uninstall',
-      'template' => 'system-modules-uninstall--custom',
-      'path' => $module_path . '/templates',
-    ],
-    'system_modules_details__custom' => [
-      'render element' => 'form',
-      'base hook' => 'system_modules_details',
-      'template' => 'system-modules-details--custom',
-      'path' => $module_path . '/templates',
-    ],
-    'system_modules_details__custom_filter' => [
-      'render element' => 'form',
-      'base hook' => 'system_modules_details',
-      'template' => 'system-modules-details--custom-filter',
-      'path' => $module_path . '/templates',
-    ],
-    'update_project_status__custom' => [
-      'base hook' => 'update_project_status',
-      'template' => 'update-project-status--custom',
-      'path' => $module_path . '/templates',
-    ],
-    'module_usage_update_page__custom' => [
-      'variables' => [
-        'machine_name' => NULL,
-      ],
-    ],
-    'module_usage_report' => [
-      'variables' => [
-        'module_data' => NULL,
-      ],
-    ],
-    'module_usage_report_recent' => [
-      'variables' => [
-        'module_data' => NULL,
-      ],
-    ],
-  ];
+#[LegacyHook]
+function module_usage_theme($existing, $type, $theme, $path): array
+{
+    return \Drupal::service(ModuleUsageHooks::class)->theme($existing, $type, $theme, $path);
 }
 
 /**
  * Implements hook_form_FORM_ID_alter().
  */
-function module_usage_form_system_modules_alter(&$form, FormStateInterface $form_state, $form_id) {
-
-  $form['filters']['module-usage-filter'] = [
-    '#type' => 'radios',
-    '#options' => [
-      'All' => t('All'),
-      'With' => t('Modules that have usage documentation'),
-      'Without' => t('Modules that do not have usage documentation'),
-    ],
-  ];
-
-  $form['#attached']['drupalSettings']['moduleUsage']['hasDocumentation'] = \Drupal::service('module_usage.query')->withDocumentation();
+#[LegacyHook]
+function module_usage_form_system_modules_alter(&$form, FormStateInterface $form_state, $form_id)
+{
+    \Drupal::service(ModuleUsageHooks::class)->formSystemModulesAlter($form, $form_state, $form_id);
 }
 
 /**
  * Implements hook_preprocess_HOOK().
  */
+#[LegacyHook]
 function module_usage_preprocess_table(&$variables) {
-  if (\Drupal::routeMatch()->getRouteName() == 'update.module_update') {
-    // Iterate over each row.
-    if ($variables['attributes']['data-drupal-selector'] == 'edit-projects') {
-      $dom = new DOMDocument();
-
-      foreach ($variables['rows'] as &$row) {
-
-        $checkbox = (string) $row['cells'][0]['content'];
-
-        @$dom->loadHTML($checkbox);
-        $xpath = new DOMXPath($dom);
-        $inputs = $xpath->query('//input');
-        if (!empty($inputs)) {
-          $id = $inputs[0]->getAttribute('id');
-          $machine_name = str_replace('edit-projects-', '', $id);
-          $machine_name = str_replace('-', '_', $machine_name);
-        }
-
-        // Check if the second cell exists.
-        if (isset($row['cells'][1]) && !empty($machine_name)) {
-          // Update the second cell's content.
-          $row['cells'][1]['content']['usage'] = [
-            '#theme' => 'module_usage_update_page__custom',
-            '#machine_name' => $machine_name,
-          ];
-        }
-      }
-
-      $variables['#attached']['library'][] = 'module_usage/module_usage';
-    }
-
-  }
+  \Drupal::service(ModuleUsageHooks::class)->preprocessTable($variables);
 }
 
 /**
  * Implements hook_form_FORM_ID_alter().
  */
+#[LegacyHook]
 function module_usage_form_module_filter_update_status_form_alter(&$form, FormStateInterface $form_state, $form_id) {
-  $form['#attached']['library'][] = 'module_usage/module_usage';
+  \Drupal::service(ModuleUsageHooks::class)->formModuleFilterUpdateStatusFormAlter($form, $form_state, $form_id);
 }
 
 /**
  * Implements hook_modules_installed().
  */
-function module_usage_modules_installed($modules, $is_syncing): void {
-  Drupal::service('module_usage.usage_service')->modulesInstalled($modules);
-  Drupal::messenger()->addMessage(t('Now would be great time to document why you installed :modules. Find the module in the list below and click on Module Usage Documentation', [
-    ':modules' => count($modules) > 1 ? 'these modules' : 'this module',
-  ]));
+#[LegacyHook]
+function module_usage_modules_installed($modules, $is_syncing): void
+{
+    \Drupal::service(ModuleUsageHooks::class)->modulesInstalled($modules, $is_syncing);
 }
 
 /**
  * Implements hook_modules_uninstalled().
  */
-function module_usage_modules_uninstalled($modules, $is_syncing): void {
-  Drupal::service('module_usage.usage_service')->modulesUninstalled($modules);
-  Drupal::messenger()->addMessage(t('Now would be great time to document why you uninstalled :modules. Find the module in the list on the Extend page and click on Module Usage Documentation', [
-    ':modules' => count($modules) > 1 ? 'these modules' : 'this module',
-  ]));
+#[LegacyHook]
+function module_usage_modules_uninstalled($modules, $is_syncing): void
+{
+    \Drupal::service(ModuleUsageHooks::class)->modulesUninstalled($modules, $is_syncing);
 }
 
 /**
@@ -241,362 +123,25 @@ function module_usage_modules_uninstalled($modules, $is_syncing): void {
  *
  * Implements hook_cron().
  */
-function module_usage_cron() : void {
-
-  /** @var \Drupal\module_usage\Services\ModuleUsageService $service */
-  $service = Drupal::service('module_usage.usage_service');
-  $is_ultimate = \Drupal::state()->get(MODULE_USAGE_ULTIMATE_CRON_KEY, FALSE);
-  if ($is_ultimate || $service->cronRunNeeded()) {
-    $service->detectVersionChanges();
-    // Update last run time.
-    $service->cronRan();
-  }
-
-  \Drupal::state()->set(MODULE_USAGE_ULTIMATE_CRON_KEY, FALSE);
+#[LegacyHook]
+function module_usage_cron(): void
+{
+    \Drupal::service(ModuleUsageHooks::class)->cron();
 }
 
 /**
  * Implements hook_cron_pre_run().
  */
+#[LegacyHook]
 function module_usage_cron_pre_run($job) : void {
-  \Drupal::state()->set(MODULE_USAGE_ULTIMATE_CRON_KEY, TRUE);
+  \Drupal::service(ModuleUsageHooks::class)->cronPreRun($job);
 }
 
 /**
  * Implements hook_views_data_alter().
  */
-function module_usage_views_data_alter(array &$data) : array {
-  // Define the base table.
-  $data['module_usage'] = [
-    'table' => [
-      'group' => t('Module Usage'),
-      'base' => [
-  // Primary field, typically the primary key in your table.
-        'field' => 'machine_name',
-        'title' => t('Module Usage'),
-        'help' => t('Contains usage data about module usage.'),
-      ],
-    ],
-    'machine_name' => [
-      'title' => t('Machine Name'),
-      'help' => t('The machine-readable name.'),
-      'field' => [
-        'id' => 'standard',
-      ],
-      'filter' => [
-        'title' => t('Machine Name'),
-        'help' => t('The module machine name'),
-        'id' => 'string',
-      ],
-    ],
-    'description' => [
-      'title' => t('Description'),
-      'help' => t('Description of the module.'),
-      'field_alias' => 'module_usage_description',
-      'field' => [
-        'id' => 'module_usage_text_field',
-        'field_alias' => 'module_usage_description',
-      ],
-      'filter' => [
-        'title' => t('Description'),
-        'help' => t('The module description field'),
-        'id' => 'string',
-      ],
-    ],
-    'package' => [
-      'title' => t('Package'),
-      'help' => t('The package the module belongs to.'),
-      'field' => [
-        'id' => 'standard',
-      ],
-      'filter' => [
-        'title' => t('Package'),
-        'help' => t('The package the module belongs to.'),
-        'id' => 'string',
-      ],
-    ],
-    'name' => [
-      'title' => t('Name'),
-      'help' => t('The human-readable name.'),
-      'field' => [
-        'id' => 'standard',
-      ],
-      'filter' => [
-        'title' => t('Name'),
-        'help' => t('The human-readable name.'),
-        'id' => 'string',
-      ],
-    ],
-    'version' => [
-      'title' => t('Version'),
-      'help' => t('Version of the module.'),
-      'field' => [
-        'id' => 'standard',
-      ],
-      'filter' => [
-        'title' => t('Name'),
-        'help' => t('The module version number.'),
-        'id' => 'string',
-      ],
-    ],
-    'description_last_updated' => [
-      'title' => t('Description last updated date'),
-      'help' => t('Description last updated date.'),
-      'field' => [
-    // Assuming the status is a boolean (enabled/disabled).
-        'id' => 'date',
-      ],
-    ],
-    'status' => [
-      'title' => t('Status'),
-      'help' => t('Status of the module (enabled/disabled).'),
-      'field' => [
-    // Assuming the status is a boolean (enabled/disabled).
-        'id' => 'boolean',
-      ],
-      'filter' => [
-        'title' => t('Status'),
-        'help' => t('The module status.'),
-        'id' => 'boolean',
-      ],
-    ],
-    'created' => [
-      'title' => t('Creation date'),
-      'help' => t('Creation date.'),
-      'field' => [
-        'id' => 'date',
-      ],
-      'filter' => [
-        'title' => t('Creation Date'),
-        'help' => t('The module usage record creation date.'),
-        'id' => 'date',
-      ],
-    ],
-    'changed' => [
-      'title' => t('Modified date'),
-      'help' => t('Modified date.'),
-      'field' => [
-        'id' => 'date',
-      ],
-      'filter' => [
-        'title' => t('Modified Date'),
-        'help' => t('The module usage record modified date.'),
-        'id' => 'date',
-      ],
-    ],
-  ];
-
-  $data['module_usage_urls'] = [
-    'table' => [
-      'group' => t('Module Usage URLs'),
-      'base' => [
-  // Primary field, typically the primary key in your table.
-        'field' => 'id',
-        'title' => t('Module Usage URLs'),
-        'help' => t('Contains usage data about module usage URLs.'),
-      ],
-    ],
-    'id' => [
-      'title' => t('URL ID'),
-      'field' => [
-        'id' => 'standard',
-      ],
-      'help' => 'Primary Key: Unique ID.',
-
-    ],
-    'machine_name' => [
-      'title' => t('Machine Name'),
-      'help' => t('The machine-readable name.'),
-      'field' => [
-        'id' => 'standard',
-      ],
-    ],
-    'url' => [
-      'title' => t('URL'),
-      'help' => t('Internal URL.'),
-      'field' => [
-        'id' => 'standard',
-      ],
-    ],
-    'url_description' => [
-      'title' => t('URL Description'),
-      'help' => t('URL description.'),
-      'field' => [
-        'id' => 'module_usage_text_field',
-      ],
-    ],
-    'text_format' => [
-      'title' => t('Text Format'),
-      'help' => t('Format'),
-      'field' => [
-        'id' => 'standard',
-      ],
-    ],
-    'created' => [
-      'title' => t('URL creation date'),
-      'help' => t('URL creation date.'),
-      'field' => [
-        'id' => 'date',
-      ],
-    ],
-    'changed' => [
-      'title' => t('URL modified date'),
-      'help' => t('URL modified date.'),
-      'field' => [
-        'id' => 'date',
-      ],
-    ],
-  ];
-
-  $data['module_usage_notes'] = [
-    'table' => [
-      'group' => t('Module Usage Notes'),
-      'base' => [
-        'field' => 'id',
-        // Primary field, typically the primary key in your table.
-        'title' => t('Module Usage Notes'),
-        'help' => t('Contains usage data about module usage Notes.'),
-      ],
-    ],
-    'id' => [
-      'title' => t('ID'),
-      'field' => [
-        'id' => 'standard',
-      ],
-      'help' => 'Primary Key: Unique ID.',
-
-    ],
-    'machine_name' => [
-      'title' => t('Machine Name'),
-      'help' => t('The machine-readable name.'),
-      'field' => [
-        'id' => 'standard',
-      ],
-    ],
-    'created' => [
-      'title' => t('Note creation date'),
-      'help' => t('Note creation date.'),
-      'field' => [
-        'id' => 'date',
-      ],
-    ],
-    'changed' => [
-      'title' => t('Note modified date'),
-      'help' => t('Note modified date.'),
-      'field' => [
-        'id' => 'date',
-      ],
-    ],
-    'note_title' => [
-      'title' => t('Note title'),
-      'help' => t('Note title.'),
-      'field' => [
-        'id' => 'standard',
-      ],
-    ],
-    'note_text' => [
-      'title' => t('Note text'),
-      'help' => t('Note text.'),
-      'field' => [
-        'id' => 'module_usage_text_field',
-      ],
-    ],
-    'text_format' => [
-      'title' => t('Text Format'),
-      'help' => t('Format'),
-      'field' => [
-        'id' => 'standard',
-      ],
-    ],
-  ];
-
-  $data['module_usage_activity'] = [
-    'table' => [
-      'group' => t('Module Usage Activity'),
-      'base' => [
-        'field' => 'id',
-        'title' => t('Module Usage Activity'),
-        'help' => t('Contains data about module usage Activity.'),
-      ],
-    ],
-    'id' => [
-      'title' => t('Activity ID'),
-      'help' => t('ID'),
-      'field' => [
-        'id' => 'standard',
-      ],
-    ],
-    'machine_name' => [
-      'title' => t('Machine Name'),
-      'help' => t('The machine-readable name.'),
-      'field' => [
-        'id' => 'standard',
-      ],
-    ],
-    'activity_date' => [
-      'title' => t('Activity Date'),
-      'help' => t('The date the activity occurred.'),
-      'field' => [
-        'id' => 'date',
-      ],
-    ],
-    'current_version' => [
-      'title' => t('Current version'),
-      'help' => t('Current version of module'),
-      'field' => [
-        'id' => 'standard',
-      ],
-    ],
-    'status' => [
-      'title' => t('Status'),
-      'help' => t('The module status.'),
-      'field' => [
-        'id' => 'standard',
-      ],
-    ],
-    'event_description' => [
-      'title' => t('Description'),
-      'help' => t('Description of the activity.'),
-      'field' => [
-        'id' => 'standard',
-      ],
-    ],
-  ];
-
-  $data['module_usage']['module_usage_urls_relationship'] = [
-    'title' => t('Module URLs'),
-    'help' => t('Relate Module Usage to URLs'),
-    'relationship' => [
-      'base' => 'module_usage_urls',
-      'base field' => 'machine_name',
-      'relationship field' => 'machine_name',
-      'id' => 'standard',
-      'label' => t('URLs related to a module usage record'),
-    ],
-  ];
-
-  $data['module_usage']['module_usage_notes_relationship'] = [
-    'title' => t('Module Notes'),
-    'help' => t('Relate Module Usage to Notes'),
-    'relationship' => [
-      'base' => 'module_usage_notes',
-      'base field' => 'machine_name',
-      'relationship field' => 'machine_name',
-      'id' => 'standard',
-      'label' => t('Notes related to a module usage record'),
-    ],
-  ];
-
-  $data['module_usage']['module_usage_activity_relationship'] = [
-    'title' => t('Module Activity'),
-    'help' => t('Relate Module Usage to Activity'),
-    'relationship' => [
-      'base' => 'module_usage_activity',
-      'base field' => 'machine_name',
-      'relationship field' => 'machine_name',
-      'id' => 'standard',
-      'label' => t('Notes related to a module usage record'),
-    ],
-  ];
-  return $data;
+#[LegacyHook]
+function module_usage_views_data_alter(array &$data): array
+{
+    return \Drupal::service(ModuleUsageHooks::class)->viewsDataAlter($data);
 }
diff --git a/module_usage.services.yml b/module_usage.services.yml
index 725c9c0..0bb5b2b 100644
--- a/module_usage.services.yml
+++ b/module_usage.services.yml
@@ -6,3 +6,7 @@ services:
   module_usage.query:
     class: Drupal\module_usage\Services\QueryService
     arguments: ['@database', '@extension.list.module']
+
+  Drupal\module_usage\Hook\ModuleUsageHooks:
+    class: Drupal\module_usage\Hook\ModuleUsageHooks
+    autowire: true
diff --git a/src/Form/AddEditNoteForm.php b/src/Form/AddEditNoteForm.php
index 81dce7a..6124fd8 100644
--- a/src/Form/AddEditNoteForm.php
+++ b/src/Form/AddEditNoteForm.php
@@ -2,6 +2,8 @@
 
 namespace Drupal\module_usage\Form;
 
+use Drupal\Component\Utility\DeprecationHelper;
+use Drupal\filter\FilterFormatRepositoryInterface;
 use Drupal\Core\Ajax\AjaxResponse;
 use Drupal\Core\Ajax\CloseModalDialogCommand;
 use Drupal\Core\Ajax\InvokeCommand;
@@ -37,7 +39,7 @@ class AddEditNoteForm extends FormBase {
       $noteObj = \Drupal::service('module_usage.usage_service')->getNote($noteId);
     }
 
-    $formats = filter_formats();
+    $formats = DeprecationHelper::backwardsCompatibleCall(\Drupal::VERSION, '11.4.0', fn() => \Drupal::service(FilterFormatRepositoryInterface::class)->getAllFormats(), fn() => filter_formats());
     $default_format = ($formats) ? key($formats) : '';
     $text_format = ($noteObj) ? $noteObj['text_format'] : $default_format;
 
diff --git a/src/Form/AddEditURLForm.php b/src/Form/AddEditURLForm.php
index 9bbc27a..847e75e 100644
--- a/src/Form/AddEditURLForm.php
+++ b/src/Form/AddEditURLForm.php
@@ -2,6 +2,8 @@
 
 namespace Drupal\module_usage\Form;
 
+use Drupal\Component\Utility\DeprecationHelper;
+use Drupal\filter\FilterFormatRepositoryInterface;
 use Drupal\Component\Utility\UrlHelper;
 use Drupal\Core\Ajax\AjaxResponse;
 use Drupal\Core\Ajax\CloseModalDialogCommand;
@@ -39,7 +41,7 @@ class AddEditURLForm extends FormBase {
       $urlObj = \Drupal::service('module_usage.usage_service')->getUrl($urlID);
     }
 
-    $formats = filter_formats();
+    $formats = DeprecationHelper::backwardsCompatibleCall(\Drupal::VERSION, '11.4.0', fn() => \Drupal::service(FilterFormatRepositoryInterface::class)->getAllFormats(), fn() => filter_formats());
     $default_format = ($formats) ? key($formats) : '';
     $text_format = ($urlObj) ? $urlObj['text_format'] : $default_format;
 
diff --git a/src/Form/EditDescriptionForm.php b/src/Form/EditDescriptionForm.php
index 8be9576..aef1fcf 100644
--- a/src/Form/EditDescriptionForm.php
+++ b/src/Form/EditDescriptionForm.php
@@ -2,6 +2,8 @@
 
 namespace Drupal\module_usage\Form;
 
+use Drupal\Component\Utility\DeprecationHelper;
+use Drupal\filter\FilterFormatRepositoryInterface;
 use Drupal\Core\Ajax\AjaxResponse;
 use Drupal\Core\Ajax\CloseModalDialogCommand;
 use Drupal\Core\Ajax\InvokeCommand;
@@ -36,7 +38,7 @@ class EditDescriptionForm extends FormBase {
       ];
     }
 
-    $formats = filter_formats();
+    $formats = DeprecationHelper::backwardsCompatibleCall(\Drupal::VERSION, '11.4.0', fn() => \Drupal::service(FilterFormatRepositoryInterface::class)->getAllFormats(), fn() => filter_formats());
     $default_format = ($formats) ? key($formats) : '';
     $text_format = $module->text_format ?? $default_format;
 
diff --git a/src/Hook/ModuleUsageHooks.php b/src/Hook/ModuleUsageHooks.php
new file mode 100644
index 0000000..11d073f
--- /dev/null
+++ b/src/Hook/ModuleUsageHooks.php
@@ -0,0 +1,600 @@
+<?php
+
+namespace Drupal\module_usage\Hook;
+
+use Drupal\Core\Form\FormStateInterface;
+use Drupal\Core\Hook\Attribute\Hook;
+use Drupal\Core\StringTranslation\StringTranslationTrait;
+/**
+ * Hook implementations for module_usage.
+ */
+class ModuleUsageHooks
+{
+    use StringTranslationTrait;
+    /**
+     * Implements hook_preprocess_HOOK().
+     */
+    #[Hook('preprocess_system_modules_details__custom')]
+    public function preprocessSystemModulesDetailsCustom(&$variables): void
+    {
+        $variables['#attached']['library'][] = 'module_usage/module_usage';
+    }
+    /**
+     * Implements hook_preprocess_HOOK().
+     */
+    #[Hook('preprocess_system_modules_details__custom_filter')]
+    public function preprocessSystemModulesDetailsCustomFilter(&$variables): void
+    {
+        $variables['#attached']['library'][] = 'module_usage/module_usage';
+    }
+    /**
+     * Implements hook_preprocess_HOOK().
+     */
+    #[Hook('preprocess_system_modules_uninstall__custom')]
+    public function preprocessSystemModulesUninstallCustom(&$variables): void
+    {
+        $variables['#attached']['library'][] = 'module_usage/module_usage';
+    }
+    /**
+     * Implements hook_preprocess_HOOK().
+     */
+    #[Hook('preprocess_update_project_status__custom')]
+    public function preprocessUpdateProjectStatusCustom(&$variables): void
+    {
+        $variables['#attached']['library'][] = 'module_usage/module_usage';
+    }
+    /**
+     * Implements hook_theme_suggestions_HOOK_alter().
+     */
+    #[Hook('theme_suggestions_system_modules_details_alter')]
+    public function themeSuggestionsSystemModulesDetailsAlter(array &$suggestions, array $variables): void
+    {
+        // Add a new suggestion that is more specific than the theme's.
+        if (\Drupal::moduleHandler()->moduleExists('module_filter')) {
+            $suggestions[] = 'system_modules_details__custom_filter';
+        } else {
+            $suggestions[] = 'system_modules_details__custom';
+        }
+    }
+    /**
+     * Implements hook_theme_suggestions_HOOK_alter().
+     */
+    #[Hook('theme_suggestions_system_modules_uninstall_alter')]
+    public function themeSuggestionsSystemModulesUninstallAlter(array &$suggestions, array $variables): void
+    {
+        $suggestions[] = 'system_modules_uninstall__custom';
+    }
+    /**
+     * Implements hook_theme_suggestions_HOOK_alter().
+     */
+    #[Hook('theme_suggestions_update_project_status_alter')]
+    public function themeSuggestionsUpdateProjectStatusAlter(array &$suggestions, array $variables): void
+    {
+        $suggestions[] = 'update_project_status__custom';
+    }
+    /**
+     * Implements hook_theme().
+     */
+    #[Hook('theme')]
+    public function theme($existing, $type, $theme, $path): array
+    {
+        $extensionResolver = \Drupal::service('extension.path.resolver');
+        $module_path = $extensionResolver->getPath('module', 'module_usage');
+        return [
+            'module_usage_view' => [
+                'variables' => [
+                    'item' => NULL,
+                    'activity' => NULL,
+                    'notes' => NULL,
+                    'urls' => NULL,
+                    'description' => NULL,
+                ],
+            ],
+            'module_accordion' => [
+                'variables' => [
+                    'item' => NULL,
+                    'activity' => NULL,
+                    'notes' => NULL,
+                    'urls' => NULL,
+                    'description' => NULL,
+                ],
+            ],
+            'module_usage__description' => [
+                'variables' => [
+                    'machine_name' => NULL,
+                    'description' => NULL,
+                    'description_last_updated' => NULL,
+                ],
+            ],
+            'module_usage__urls' => [
+                'variables' => [
+                    'urls' => NULL,
+                    'machine_name' => NULL,
+                    'attributes' => NULL,
+                ],
+            ],
+            'module_usage__notes' => [
+                'variables' => [
+                    'notes' => NULL,
+                    'attributes' => NULL,
+                    'machine_name' => NULL,
+                ],
+            ],
+            'system_modules_uninstall__custom' => [
+                'render element' => 'form',
+                'base hook' => 'system_modules_uninstall',
+                'template' => 'system-modules-uninstall--custom',
+                'path' => $module_path . '/templates',
+            ],
+            'system_modules_details__custom' => [
+                'render element' => 'form',
+                'base hook' => 'system_modules_details',
+                'template' => 'system-modules-details--custom',
+                'path' => $module_path . '/templates',
+            ],
+            'system_modules_details__custom_filter' => [
+                'render element' => 'form',
+                'base hook' => 'system_modules_details',
+                'template' => 'system-modules-details--custom-filter',
+                'path' => $module_path . '/templates',
+            ],
+            'update_project_status__custom' => [
+                'base hook' => 'update_project_status',
+                'template' => 'update-project-status--custom',
+                'path' => $module_path . '/templates',
+            ],
+            'module_usage_update_page__custom' => [
+                'variables' => [
+                    'machine_name' => NULL,
+                ],
+            ],
+            'module_usage_report' => [
+                'variables' => [
+                    'module_data' => NULL,
+                ],
+            ],
+            'module_usage_report_recent' => [
+                'variables' => [
+                    'module_data' => NULL,
+                ],
+            ],
+        ];
+    }
+    /**
+     * Implements hook_form_FORM_ID_alter().
+     */
+    #[Hook('form_system_modules_alter')]
+    public function formSystemModulesAlter(&$form, \Drupal\Core\Form\FormStateInterface $form_state, $form_id)
+    {
+        $form['filters']['module-usage-filter'] = [
+            '#type' => 'radios',
+            '#options' => [
+                'All' => $this->t('All'),
+                'With' => $this->t('Modules that have usage documentation'),
+                'Without' => $this->t('Modules that do not have usage documentation'),
+            ],
+        ];
+        $form['#attached']['drupalSettings']['moduleUsage']['hasDocumentation'] = \Drupal::service('module_usage.query')->withDocumentation();
+    }
+    /**
+     * Implements hook_preprocess_HOOK().
+     */
+    #[Hook('preprocess_table')]
+    public function preprocessTable(&$variables)
+    {
+        if (\Drupal::routeMatch()->getRouteName() == 'update.module_update') {
+            // Iterate over each row.
+            if ($variables['attributes']['data-drupal-selector'] == 'edit-projects') {
+                $dom = new \DOMDocument();
+                foreach ($variables['rows'] as &$row) {
+                    $checkbox = (string) $row['cells'][0]['content'];
+                    @$dom->loadHTML($checkbox);
+                    $xpath = new \DOMXPath($dom);
+                    $inputs = $xpath->query('//input');
+                    if (!empty($inputs)) {
+                        $id = $inputs[0]->getAttribute('id');
+                        $machine_name = str_replace('edit-projects-', '', $id);
+                        $machine_name = str_replace('-', '_', $machine_name);
+                    }
+                    // Check if the second cell exists.
+                    if (isset($row['cells'][1]) && !empty($machine_name)) {
+                        // Update the second cell's content.
+                        $row['cells'][1]['content']['usage'] = [
+                            '#theme' => 'module_usage_update_page__custom',
+                            '#machine_name' => $machine_name,
+                        ];
+                    }
+                }
+                $variables['#attached']['library'][] = 'module_usage/module_usage';
+            }
+        }
+    }
+    /**
+     * Implements hook_form_FORM_ID_alter().
+     */
+    #[Hook('form_module_filter_update_status_form_alter')]
+    public function formModuleFilterUpdateStatusFormAlter(&$form, \Drupal\Core\Form\FormStateInterface $form_state, $form_id)
+    {
+        $form['#attached']['library'][] = 'module_usage/module_usage';
+    }
+    /**
+     * Implements hook_modules_installed().
+     */
+    #[Hook('modules_installed')]
+    public function modulesInstalled($modules, $is_syncing): void
+    {
+        \Drupal::service('module_usage.usage_service')->modulesInstalled($modules);
+        \Drupal::messenger()->addMessage($this->t('Now would be great time to document why you installed :modules. Find the module in the list below and click on Module Usage Documentation', [
+            ':modules' => count($modules) > 1 ? 'these modules' : 'this module',
+        ]));
+    }
+    /**
+     * Implements hook_modules_uninstalled().
+     */
+    #[Hook('modules_uninstalled')]
+    public function modulesUninstalled($modules, $is_syncing): void
+    {
+        \Drupal::service('module_usage.usage_service')->modulesUninstalled($modules);
+        \Drupal::messenger()->addMessage($this->t('Now would be great time to document why you uninstalled :modules. Find the module in the list on the Extend page and click on Module Usage Documentation', [
+            ':modules' => count($modules) > 1 ? 'these modules' : 'this module',
+        ]));
+    }
+    /**
+     * Cron function to detect module version changes.
+     *
+     * Implements hook_cron().
+     */
+    #[Hook('cron')]
+    public function cron(): void
+    {
+        /** @var \Drupal\module_usage\Services\ModuleUsageService $service */
+        $service = \Drupal::service('module_usage.usage_service');
+        $is_ultimate = \Drupal::state()->get(MODULE_USAGE_ULTIMATE_CRON_KEY, FALSE);
+        if ($is_ultimate || $service->cronRunNeeded()) {
+            $service->detectVersionChanges();
+            // Update last run time.
+            $service->cronRan();
+        }
+        \Drupal::state()->set(MODULE_USAGE_ULTIMATE_CRON_KEY, FALSE);
+    }
+    /**
+     * Implements hook_cron_pre_run().
+     */
+    #[Hook('cron_pre_run')]
+    public function cronPreRun($job): void
+    {
+        \Drupal::state()->set(MODULE_USAGE_ULTIMATE_CRON_KEY, TRUE);
+    }
+    /**
+     * Implements hook_views_data_alter().
+     */
+    #[Hook('views_data_alter')]
+    public function viewsDataAlter(array &$data): array
+    {
+        // Define the base table.
+        $data['module_usage'] = [
+            'table' => [
+                'group' => $this->t('Module Usage'),
+                'base' => [
+                    // Primary field, typically the primary key in your table.
+                    'field' => 'machine_name',
+                    'title' => $this->t('Module Usage'),
+                    'help' => $this->t('Contains usage data about module usage.'),
+                ],
+            ],
+            'machine_name' => [
+                'title' => $this->t('Machine Name'),
+                'help' => $this->t('The machine-readable name.'),
+                'field' => [
+                    'id' => 'standard',
+                ],
+                'filter' => [
+                    'title' => $this->t('Machine Name'),
+                    'help' => $this->t('The module machine name'),
+                    'id' => 'string',
+                ],
+            ],
+            'description' => [
+                'title' => $this->t('Description'),
+                'help' => $this->t('Description of the module.'),
+                'field_alias' => 'module_usage_description',
+                'field' => [
+                    'id' => 'module_usage_text_field',
+                    'field_alias' => 'module_usage_description',
+                ],
+                'filter' => [
+                    'title' => $this->t('Description'),
+                    'help' => $this->t('The module description field'),
+                    'id' => 'string',
+                ],
+            ],
+            'package' => [
+                'title' => $this->t('Package'),
+                'help' => $this->t('The package the module belongs to.'),
+                'field' => [
+                    'id' => 'standard',
+                ],
+                'filter' => [
+                    'title' => $this->t('Package'),
+                    'help' => $this->t('The package the module belongs to.'),
+                    'id' => 'string',
+                ],
+            ],
+            'name' => [
+                'title' => $this->t('Name'),
+                'help' => $this->t('The human-readable name.'),
+                'field' => [
+                    'id' => 'standard',
+                ],
+                'filter' => [
+                    'title' => $this->t('Name'),
+                    'help' => $this->t('The human-readable name.'),
+                    'id' => 'string',
+                ],
+            ],
+            'version' => [
+                'title' => $this->t('Version'),
+                'help' => $this->t('Version of the module.'),
+                'field' => [
+                    'id' => 'standard',
+                ],
+                'filter' => [
+                    'title' => $this->t('Name'),
+                    'help' => $this->t('The module version number.'),
+                    'id' => 'string',
+                ],
+            ],
+            'description_last_updated' => [
+                'title' => $this->t('Description last updated date'),
+                'help' => $this->t('Description last updated date.'),
+                'field' => [
+                    // Assuming the status is a boolean (enabled/disabled).
+                    'id' => 'date',
+                ],
+            ],
+            'status' => [
+                'title' => $this->t('Status'),
+                'help' => $this->t('Status of the module (enabled/disabled).'),
+                'field' => [
+                    // Assuming the status is a boolean (enabled/disabled).
+                    'id' => 'boolean',
+                ],
+                'filter' => [
+                    'title' => $this->t('Status'),
+                    'help' => $this->t('The module status.'),
+                    'id' => 'boolean',
+                ],
+            ],
+            'created' => [
+                'title' => $this->t('Creation date'),
+                'help' => $this->t('Creation date.'),
+                'field' => [
+                    'id' => 'date',
+                ],
+                'filter' => [
+                    'title' => $this->t('Creation Date'),
+                    'help' => $this->t('The module usage record creation date.'),
+                    'id' => 'date',
+                ],
+            ],
+            'changed' => [
+                'title' => $this->t('Modified date'),
+                'help' => $this->t('Modified date.'),
+                'field' => [
+                    'id' => 'date',
+                ],
+                'filter' => [
+                    'title' => $this->t('Modified Date'),
+                    'help' => $this->t('The module usage record modified date.'),
+                    'id' => 'date',
+                ],
+            ],
+        ];
+        $data['module_usage_urls'] = [
+            'table' => [
+                'group' => $this->t('Module Usage URLs'),
+                'base' => [
+                    // Primary field, typically the primary key in your table.
+                    'field' => 'id',
+                    'title' => $this->t('Module Usage URLs'),
+                    'help' => $this->t('Contains usage data about module usage URLs.'),
+                ],
+            ],
+            'id' => [
+                'title' => $this->t('URL ID'),
+                'field' => [
+                    'id' => 'standard',
+                ],
+                'help' => 'Primary Key: Unique ID.',
+            ],
+            'machine_name' => [
+                'title' => $this->t('Machine Name'),
+                'help' => $this->t('The machine-readable name.'),
+                'field' => [
+                    'id' => 'standard',
+                ],
+            ],
+            'url' => [
+                'title' => $this->t('URL'),
+                'help' => $this->t('Internal URL.'),
+                'field' => [
+                    'id' => 'standard',
+                ],
+            ],
+            'url_description' => [
+                'title' => $this->t('URL Description'),
+                'help' => $this->t('URL description.'),
+                'field' => [
+                    'id' => 'module_usage_text_field',
+                ],
+            ],
+            'text_format' => [
+                'title' => $this->t('Text Format'),
+                'help' => $this->t('Format'),
+                'field' => [
+                    'id' => 'standard',
+                ],
+            ],
+            'created' => [
+                'title' => $this->t('URL creation date'),
+                'help' => $this->t('URL creation date.'),
+                'field' => [
+                    'id' => 'date',
+                ],
+            ],
+            'changed' => [
+                'title' => $this->t('URL modified date'),
+                'help' => $this->t('URL modified date.'),
+                'field' => [
+                    'id' => 'date',
+                ],
+            ],
+        ];
+        $data['module_usage_notes'] = [
+            'table' => [
+                'group' => $this->t('Module Usage Notes'),
+                'base' => [
+                    'field' => 'id',
+                    // Primary field, typically the primary key in your table.
+                    'title' => $this->t('Module Usage Notes'),
+                    'help' => $this->t('Contains usage data about module usage Notes.'),
+                ],
+            ],
+            'id' => [
+                'title' => $this->t('ID'),
+                'field' => [
+                    'id' => 'standard',
+                ],
+                'help' => 'Primary Key: Unique ID.',
+            ],
+            'machine_name' => [
+                'title' => $this->t('Machine Name'),
+                'help' => $this->t('The machine-readable name.'),
+                'field' => [
+                    'id' => 'standard',
+                ],
+            ],
+            'created' => [
+                'title' => $this->t('Note creation date'),
+                'help' => $this->t('Note creation date.'),
+                'field' => [
+                    'id' => 'date',
+                ],
+            ],
+            'changed' => [
+                'title' => $this->t('Note modified date'),
+                'help' => $this->t('Note modified date.'),
+                'field' => [
+                    'id' => 'date',
+                ],
+            ],
+            'note_title' => [
+                'title' => $this->t('Note title'),
+                'help' => $this->t('Note title.'),
+                'field' => [
+                    'id' => 'standard',
+                ],
+            ],
+            'note_text' => [
+                'title' => $this->t('Note text'),
+                'help' => $this->t('Note text.'),
+                'field' => [
+                    'id' => 'module_usage_text_field',
+                ],
+            ],
+            'text_format' => [
+                'title' => $this->t('Text Format'),
+                'help' => $this->t('Format'),
+                'field' => [
+                    'id' => 'standard',
+                ],
+            ],
+        ];
+        $data['module_usage_activity'] = [
+            'table' => [
+                'group' => $this->t('Module Usage Activity'),
+                'base' => [
+                    'field' => 'id',
+                    'title' => $this->t('Module Usage Activity'),
+                    'help' => $this->t('Contains data about module usage Activity.'),
+                ],
+            ],
+            'id' => [
+                'title' => $this->t('Activity ID'),
+                'help' => $this->t('ID'),
+                'field' => [
+                    'id' => 'standard',
+                ],
+            ],
+            'machine_name' => [
+                'title' => $this->t('Machine Name'),
+                'help' => $this->t('The machine-readable name.'),
+                'field' => [
+                    'id' => 'standard',
+                ],
+            ],
+            'activity_date' => [
+                'title' => $this->t('Activity Date'),
+                'help' => $this->t('The date the activity occurred.'),
+                'field' => [
+                    'id' => 'date',
+                ],
+            ],
+            'current_version' => [
+                'title' => $this->t('Current version'),
+                'help' => $this->t('Current version of module'),
+                'field' => [
+                    'id' => 'standard',
+                ],
+            ],
+            'status' => [
+                'title' => $this->t('Status'),
+                'help' => $this->t('The module status.'),
+                'field' => [
+                    'id' => 'standard',
+                ],
+            ],
+            'event_description' => [
+                'title' => $this->t('Description'),
+                'help' => $this->t('Description of the activity.'),
+                'field' => [
+                    'id' => 'standard',
+                ],
+            ],
+        ];
+        $data['module_usage']['module_usage_urls_relationship'] = [
+            'title' => $this->t('Module URLs'),
+            'help' => $this->t('Relate Module Usage to URLs'),
+            'relationship' => [
+                'base' => 'module_usage_urls',
+                'base field' => 'machine_name',
+                'relationship field' => 'machine_name',
+                'id' => 'standard',
+                'label' => $this->t('URLs related to a module usage record'),
+            ],
+        ];
+        $data['module_usage']['module_usage_notes_relationship'] = [
+            'title' => $this->t('Module Notes'),
+            'help' => $this->t('Relate Module Usage to Notes'),
+            'relationship' => [
+                'base' => 'module_usage_notes',
+                'base field' => 'machine_name',
+                'relationship field' => 'machine_name',
+                'id' => 'standard',
+                'label' => $this->t('Notes related to a module usage record'),
+            ],
+        ];
+        $data['module_usage']['module_usage_activity_relationship'] = [
+            'title' => $this->t('Module Activity'),
+            'help' => $this->t('Relate Module Usage to Activity'),
+            'relationship' => [
+                'base' => 'module_usage_activity',
+                'base field' => 'machine_name',
+                'relationship field' => 'machine_name',
+                'id' => 'standard',
+                'label' => $this->t('Notes related to a module usage record'),
+            ],
+        ];
+        return $data;
+    }
+}
