diff --git a/web/modules/custom/blog/hooks/entity_type/build.inc b/web/modules/custom/blog/hooks/entity_type/build.inc
deleted file mode 100644
index 4978ce1..0000000
--- a/web/modules/custom/blog/hooks/entity_type/build.inc
+++ /dev/null
@@ -1,20 +0,0 @@
-setStorageClass(NodeStorage::class);
- }
-}
diff --git a/web/modules/custom/blog/hooks/node_links/alter.inc b/web/modules/custom/blog/hooks/node_links/alter.inc
deleted file mode 100644
index bc94afc..0000000
--- a/web/modules/custom/blog/hooks/node_links/alter.inc
+++ /dev/null
@@ -1,28 +0,0 @@
-getExternalLink()) {
- $links['node']['#links']['node-readmore']['url'] = Url::fromUri($link['uri']);
- $links['node']['#links']['node-readmore']['title'] = t('Read more about @title (on @domain)', [
- '@domain' => $link['title'],
- '@title' => $node->label(),
- ]);
- }
-}
diff --git a/web/modules/custom/blog/hooks/preprocess/block.inc b/web/modules/custom/blog/hooks/preprocess/block.inc
deleted file mode 100644
index f9032b3..0000000
--- a/web/modules/custom/blog/hooks/preprocess/block.inc
+++ /dev/null
@@ -1,18 +0,0 @@
-getExternalLink()) {
- $variables['url'] = $link['uri'];
- }
-}
diff --git a/web/modules/custom/blog/opdavies_blog.module b/web/modules/custom/blog/opdavies_blog.module
index 6bb1aa5..062e242 100644
--- a/web/modules/custom/blog/opdavies_blog.module
+++ b/web/modules/custom/blog/opdavies_blog.module
@@ -2,17 +2,59 @@
/**
* @file
- * Custom module.
+ * Custom blog code.
*/
-declare(strict_types=1);
+use Drupal\Core\Url;
+use Drupal\discoverable_entity_bundle_classes\Storage\Node\NodeStorage;
+use Drupal\node\NodeInterface;
-use Symfony\Component\Finder\Finder;
-
-$finder = Finder::create()
- ->in(__DIR__ . DIRECTORY_SEPARATOR . 'hooks')
- ->name('/.[php|inc]$/');
-
-foreach ($finder as $file) {
- include $file->getPathname();
+/**
+ * Implements hook_entity_type_build().
+ */
+function opdavies_blog_entity_type_build(array &$entityTypes): void {
+ /** @var \Drupal\Core\Entity\EntityTypeInterface[] $entityTypes */
+ if (isset($entityTypes['node'])) {
+ $entityTypes['node']->setStorageClass(NodeStorage::class);
+ }
+}
+
+/**
+ * Implements hook_node_links_alter().
+ */
+function opdavies_blog_node_links_alter(array &$links, NodeInterface $node): void {
+ if (!method_exists($node, 'getExternalLink')) {
+ return;
+ }
+
+ if ($link = $node->getExternalLink()) {
+ $links['node']['#links']['node-readmore']['url'] = Url::fromUri($link['uri']);
+ $links['node']['#links']['node-readmore']['title'] = t('Read more about @title (on @domain)', [
+ '@domain' => $link['title'],
+ '@title' => $node->label(),
+ ]);
+ }
+}
+
+/**
+ * Implements hook_preprocess_HOOK().
+ */
+function opdavies_blog_preprocess_block(array &$variables): void {
+ // Add the 'markup' class to blocks.
+ if (in_array($variables['plugin_id'], ['views_block:featured_blog_posts-block_1'])) {
+ $variables['attributes']['class'][] = 'markup';
+ }
+}
+
+/**
+ * Implements hook_preprocess_HOOK().
+ */
+function opdavies_blog_preprocess_node(array &$variables): void {
+ if (!method_exists($variables['node'], 'getExternalLink')) {
+ return;
+ }
+
+ if ($link = $variables['node']->getExternalLink()) {
+ $variables['url'] = $link['uri'];
+ }
}