diff --git a/search_autocomplete.module b/search_autocomplete.module
index e19f1db..fb59deb 100644
--- a/search_autocomplete.module
+++ b/search_autocomplete.module
@@ -1,10 +1,8 @@
 <?php
 
-use Drupal\Core\Entity\Element\EntityAutocomplete;
-use Drupal\views\Views;
 use Drupal\Component\Utility\UrlHelper;
 use Drupal\Core\Url;
-use Drupal\Core\Utility\UnroutedUrlAssembler;
+use Drupal\views\Views;
 
 /**
  * @file
diff --git a/src/AutocompletionConfigurationAccessControlHandler.php b/src/AutocompletionConfigurationAccessControlHandler.php
index c0269ab..bc74d89 100644
--- a/src/AutocompletionConfigurationAccessControlHandler.php
+++ b/src/AutocompletionConfigurationAccessControlHandler.php
@@ -8,10 +8,10 @@
 
 namespace Drupal\search_autocomplete;
 
+use Drupal\Core\Access\AccessResult;
 use Drupal\Core\Entity\EntityAccessControlHandler;
 use Drupal\Core\Entity\EntityInterface;
 use Drupal\Core\Session\AccountInterface;
-use Drupal\Core\Access\AccessResult;
 
 /**
  * Defines an access controller for the autocompletion_configuration entity.
diff --git a/src/AutocompletionConfigurationInterface.php b/src/AutocompletionConfigurationInterface.php
index af08acb..30316c5 100644
--- a/src/AutocompletionConfigurationInterface.php
+++ b/src/AutocompletionConfigurationInterface.php
@@ -10,8 +10,6 @@
 namespace Drupal\search_autocomplete;
 
 use Drupal\Core\Config\Entity\ConfigEntityInterface;
-use Doctrine\Common\Annotations\Annotation\Enum;
-use Drupal\migrate\Plugin\migrate\process\Callback;
 
 /**
  * Provides an interface defining an autocompletion configuration entity.
diff --git a/src/Controller/AutocompletionConfigurationListBuilder.php b/src/Controller/AutocompletionConfigurationListBuilder.php
index 65e6ec0..6d98f22 100644
--- a/src/Controller/AutocompletionConfigurationListBuilder.php
+++ b/src/Controller/AutocompletionConfigurationListBuilder.php
@@ -7,11 +7,10 @@
 
 namespace Drupal\search_autocomplete\Controller;
 
+use Drupal\Component\Render\HtmlEscapedText;
 use Drupal\Core\Config\Entity\ConfigEntityListBuilder;
-use Drupal\Core\Entity\EntityInterface;
 use Drupal\Core\Form\FormInterface;
 use Drupal\Core\Form\FormStateInterface;
-use Drupal\Component\Utility\SafeMarkup;
 
 /**
  * Provides a listing of autocompletion_configuration entities.
@@ -81,14 +80,14 @@ class AutocompletionConfigurationListBuilder extends ConfigEntityListBuilder imp
       $deletable = $entity->getEditable() ? 'deletable' : '';
       $form['configs'][$entity_id]['#attributes'] = array('id' => array($entity_id), 'class' => array($editable, $deletable));
       $form['configs'][$entity_id]['label'] = array(
-        '#markup' => SafeMarkup::checkPlain($entity->label()),
+        '#markup' => new HtmlEscapedText($entity->label()),
       );
       $form['configs'][$entity_id]['enabled'] = array(
         '#type' => 'checkbox',
         '#default_value' => $entity->getStatus(),
       );
       $form['configs'][$entity_id]['selector'] = array(
-        '#markup' => SafeMarkup::checkPlain($entity->getSelector()),
+        '#markup' => new HtmlEscapedText($entity->getSelector()),
       );
       $form['configs'][$entity_id]['operations'] = $this->buildOperations($entity);
     }
diff --git a/src/Form/AutocompletionConfigurationAddForm.php b/src/Form/AutocompletionConfigurationAddForm.php
index a5e25f9..cef6e2b 100644
--- a/src/Form/AutocompletionConfigurationAddForm.php
+++ b/src/Form/AutocompletionConfigurationAddForm.php
@@ -104,7 +104,7 @@ class AutocompletionConfigurationAddForm extends AutocompletionConfigurationForm
     $this->entity->save();
 
     // Redirect to edit form once entity is added.
-    $form_state->setRedirectUrl($this->entity->urlInfo('edit-form'));
+    $form_state->setRedirectUrl($this->entity->toUrl('edit-form'));
   }
 
 }
diff --git a/src/Form/AutocompletionConfigurationDeleteForm.php b/src/Form/AutocompletionConfigurationDeleteForm.php
index 2e96acb..57d8ff3 100644
--- a/src/Form/AutocompletionConfigurationDeleteForm.php
+++ b/src/Form/AutocompletionConfigurationDeleteForm.php
@@ -9,8 +9,8 @@
 namespace Drupal\search_autocomplete\Form;
 
 use Drupal\Core\Entity\EntityConfirmFormBase;
-use Drupal\Core\Url;
 use Drupal\Core\Form\FormStateInterface;
+use Drupal\Core\Url;
 
 /**
  * Class AutocompletionConfigurationDeleteForm.
diff --git a/src/Form/AutocompletionConfigurationEditForm.php b/src/Form/AutocompletionConfigurationEditForm.php
index 8f32b56..8669529 100644
--- a/src/Form/AutocompletionConfigurationEditForm.php
+++ b/src/Form/AutocompletionConfigurationEditForm.php
@@ -8,16 +8,12 @@
 
 namespace Drupal\search_autocomplete\Form;
 
+use Drupal\Component\Utility\UrlHelper;
 use Drupal\Core\Form\FormStateInterface;
 use Drupal\search_autocomplete\Suggestion;
+use Drupal\views\Views;
 use Symfony\Component\HttpFoundation\JsonResponse;
 use Symfony\Component\HttpFoundation\Request;
-use Drupal\Core\Entity\Element\EntityAutocomplete;
-use Drupal\Core\Url;
-use Drupal\Component\Utility\UrlHelper;
-use Drupal\Component\Utility\Tags;
-use Drupal\Component\Utility\Unicode;
-use Drupal\views\Views;
 
 /**
  * Class AutocompletionConfigurationEditForm
diff --git a/src/Form/AutocompletionConfigurationFormBase.php b/src/Form/AutocompletionConfigurationFormBase.php
index d20503e..a98cd89 100644
--- a/src/Form/AutocompletionConfigurationFormBase.php
+++ b/src/Form/AutocompletionConfigurationFormBase.php
@@ -11,6 +11,7 @@ namespace Drupal\search_autocomplete\Form;
 use Drupal\Core\Entity\EntityForm;
 use Drupal\Core\Entity\EntityStorageInterface;
 use Drupal\Core\Form\FormStateInterface;
+use Drupal\Core\Link;
 use Symfony\Component\DependencyInjection\ContainerInterface;
 
 /**
@@ -205,10 +206,10 @@ class AutocompletionConfigurationFormBase extends EntityForm {
     $status = $autocompletion_configuration->save();
 
     // Grab the URL of the new entity. We'll use it in the message.
-    $url = $autocompletion_configuration->urlInfo();
+    $url = $autocompletion_configuration->toUrl();
 
     // Create an edit link.
-    $edit_link = $this->l(t('Edit'), $url);
+    $edit_link = Link::fromTextAndUrl(t('Edit'), $url);
 
     if ($status == SAVED_UPDATED) {
       // If we edited an existing entity...
diff --git a/src/Plugin/views/display/AutocompletionCallback.php b/src/Plugin/views/display/AutocompletionCallback.php
index e163c7e..a2f7e0c 100644
--- a/src/Plugin/views/display/AutocompletionCallback.php
+++ b/src/Plugin/views/display/AutocompletionCallback.php
@@ -8,20 +8,18 @@
 
 namespace Drupal\search_autocomplete\Plugin\views\display;
 
-use Drupal\Component\Utility\SafeMarkup;
+use Drupal\Component\Render\MarkupTrait;
 use Drupal\Core\Cache\CacheableMetadata;
 use Drupal\Core\Cache\CacheableResponse;
+use Drupal\Core\ContentNegotiation;
 use Drupal\Core\Render\RenderContext;
 use Drupal\Core\Render\RendererInterface;
-use Drupal\Core\State\StateInterface;
 use Drupal\Core\Routing\RouteProviderInterface;
-use Drupal\Core\ContentNegotiation;
+use Drupal\Core\State\StateInterface;
+use Drupal\views\Plugin\views\display\PathPluginBase;
 use Drupal\views\Plugin\views\display\ResponseDisplayPluginInterface;
 use Drupal\views\ViewExecutable;
-use Drupal\views\Plugin\views\display\PathPluginBase;
 use Symfony\Component\DependencyInjection\ContainerInterface;
-use Symfony\Component\HttpFoundation\Response;
-use Symfony\Component\Routing\RouteCollection;
 
 /**
  * The plugin that handles Data response callbacks for REST resources.
@@ -294,7 +292,7 @@ class AutocompletionCallback extends PathPluginBase implements ResponseDisplayPl
       // executed by an HTML agent.
       // @todo Decide how to support non-HTML in the render API in
       //   https://www.drupal.org/node/2501313.
-      $build['#markup'] = SafeMarkup::set($build['#markup']);
+      $build['#markup'] = MarkupTrait::create($build['#markup']);
     }
 
     parent::applyDisplayCachablityMetadata($build);
diff --git a/src/Plugin/views/row/CallbackFieldRow.php b/src/Plugin/views/row/CallbackFieldRow.php
index 67e2ddc..18095c2 100644
--- a/src/Plugin/views/row/CallbackFieldRow.php
+++ b/src/Plugin/views/row/CallbackFieldRow.php
@@ -10,9 +10,9 @@
 namespace Drupal\search_autocomplete\Plugin\views\row;
 
 use Drupal\Core\Form\FormStateInterface;
-use Drupal\views\ViewExecutable;
 use Drupal\views\Plugin\views\display\DisplayPluginBase;
 use Drupal\views\Plugin\views\row\RowPluginBase;
+use Drupal\views\ViewExecutable;
 
 /**
  * Plugin which displays fields as raw data.
diff --git a/src/Plugin/views/style/CallbackSerializer.php b/src/Plugin/views/style/CallbackSerializer.php
index 9dbd6cc..396c915 100644
--- a/src/Plugin/views/style/CallbackSerializer.php
+++ b/src/Plugin/views/style/CallbackSerializer.php
@@ -9,13 +9,11 @@
 
 namespace Drupal\search_autocomplete\Plugin\views\style;
 
+use Drupal\Component\Render\HtmlEscapedText;
 use Drupal\Component\Utility\Html;
 use Drupal\Core\Form\FormStateInterface;
-use Drupal\views\ViewExecutable;
-use Drupal\views\Plugin\views\display\DisplayPluginBase;
 use Drupal\views\Plugin\views\style\StylePluginBase;
 use Symfony\Component\DependencyInjection\ContainerInterface;
-use Drupal\Component\Utility\SafeMarkup;
 
 /**
  * The style plugin for serialized output formats.
@@ -80,7 +78,7 @@ class CallbackSerializer extends StylePluginBase {
     $form['input_label'] = array(
       '#title'          => t('Input Label'),
       '#type'           => 'select',
-      '#description'    => SafeMarkup::checkPlain($input_label_descr),
+      '#description'    => new HtmlEscapedText($input_label_descr),
       '#default_value'  => $this->options['input_label'],
       '#disabled'       => empty($field_labels),
       '#required'       => TRUE,
@@ -92,7 +90,7 @@ class CallbackSerializer extends StylePluginBase {
     $form['input_link'] = array(
       '#title'          => t('Input Link'),
       '#type'           => 'select',
-      '#description'    => SafeMarkup::checkPlain($input_link_descr),
+      '#description'    => new HtmlEscapedText($input_link_descr),
       '#default_value'  => $this->options['input_link'],
       '#disabled'       => empty($field_labels),
       '#required'       => TRUE,
diff --git a/src/Tests/Views/CallbackViewsTest.php b/src/Tests/Views/CallbackViewsTest.php
index 99fd234..6c65443 100644
--- a/src/Tests/Views/CallbackViewsTest.php
+++ b/src/Tests/Views/CallbackViewsTest.php
@@ -12,11 +12,8 @@ namespace Drupal\search_autocomplete\Tests\Views;
 
 use Drupal\Component\Render\FormattableMarkup;
 use Drupal\Component\Utility\Html;
-use Drupal\node\Entity\NodeType;
-use Drupal\views\Tests\ViewTestBase;
-use Drupal\views\Views;
 use Drupal\node\Entity\Node;
-use Drupal\Component\Utility\SafeMarkup;
+use Drupal\views\Tests\ViewTestBase;
 
 /**
  * Test callback view configurations.
@@ -158,7 +155,7 @@ class CallbackViewsTest extends ViewTestBase {
           'title'   => $type->id() . ' ' . $i,
           'created' => 'by ' . $this->adminUser->getUsername() . ' | Thu, 11/29/1973 - 21:33',
         ),
-        'link'  => $node->url('canonical', array('absolute' => TRUE)),
+        'link'  => $node->toUrl('canonical', array('absolute' => TRUE))->toString(),
       );
       if ($i == 1) {
         $result += array(
