diff --git a/src/Controller/SeoStudioController.php b/src/Controller/SeoStudioController.php
index c5809bb..1b790b9 100644
--- a/src/Controller/SeoStudioController.php
+++ b/src/Controller/SeoStudioController.php
@@ -38,7 +38,7 @@ class SeoStudioController extends ControllerBase {
     } else {
       // fallback for D8
       // @phpstan-ignore-next-line
-      $module_path = drupal_get_path('module', 'seostudio');
+      $module_path = \Drupal::service('extension.list.module')->getPath('seostudio');
     }
     // show a fieldset on top (closed by default)
     // to show the current metatags in a <code><pre> block
diff --git a/src/Form/SeoStudioForm.php b/src/Form/SeoStudioForm.php
index 1048ade..ccb66f8 100644
--- a/src/Form/SeoStudioForm.php
+++ b/src/Form/SeoStudioForm.php
@@ -167,7 +167,7 @@ class SeoStudioForm extends FormBase {
           } else {
             // fallback for D8
             // @phpstan-ignore-next-line
-            $module_path = drupal_get_path('module', 'seostudio');
+            $module_path = \Drupal::service('extension.list.module')->getPath('seostudio');
           }
           $image_path = '/' . $module_path . '/images/meta-tags.jpg';
 
diff --git a/src/NodeDataFetcher.php b/src/NodeDataFetcher.php
index 88027b5..a961261 100644
--- a/src/NodeDataFetcher.php
+++ b/src/NodeDataFetcher.php
@@ -110,7 +110,7 @@ class NodeDataFetcher {
           } else {
             // Fallback if the service does not exist
             if (function_exists('file_url_transform_relative')) {
-              $tag = file_url_transform_relative($tag);
+              $tag = \Drupal::service('file_url_generator')->transformRelative($tag);
             }
           }
           $tag = $site_base_url . $base_path . $tag;
