diff --git a/src/Plugin/Field/FieldFormatter/YouTubeThumbFormatter.php b/src/Plugin/Field/FieldFormatter/YouTubeThumbFormatter.php
index 77c9750..c921f84 100644
--- a/src/Plugin/Field/FieldFormatter/YouTubeThumbFormatter.php
+++ b/src/Plugin/Field/FieldFormatter/YouTubeThumbFormatter.php
@@ -6,12 +6,12 @@
  */
 
 namespace Drupal\youtube\Plugin\Field\FieldFormatter;
+
 use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Field\FieldItemListInterface;
 use Drupal\Core\Field\FormatterBase;
 use Drupal\Core\Url;
 
-
 /**
  * Plugin implementation of the 'youtube_thumbnail' formatter.
  *
@@ -108,7 +108,7 @@ class YouTubeThumbFormatter extends FormatterBase {
     foreach ($items as $delta => $item) {
       // If the thumbnail is linked to its youtube page, take the original url.
       if (isset($link_youtube) && $link_youtube) {
-        $url = \Drupal\Core\Url::fromUri($item->input);
+        $url = Url::fromUri($item->input);
         $url->setOption('html', TRUE);
       }
 
diff --git a/youtube.module b/youtube.module
index ba5bb3b..e2f49cf 100644
--- a/youtube.module
+++ b/youtube.module
@@ -158,7 +158,7 @@ function template_preprocess_youtube_video(&$variables) {
   $path = 'https://www.' . $domain . '/embed/' . $variables['video_id'];
 
   // Build the src attribute with the path and query array constructed above.
-  $url = \Drupal\Core\Url::fromUri($path, ['query' => $query]);
+  $url = Url::fromUri($path, ['query' => $query]);
   $variables['content_attributes']['src'] = $url->toString();
 
   // Use the field's display settings to retrieve the video's dimensions.
