diff --git a/brightcove.install b/brightcove.install
index e87693d..93192bc 100644
--- a/brightcove.install
+++ b/brightcove.install
@@ -133,8 +133,8 @@ function brightcove_update_8100(&$sandbox) {
   foreach ($entries as $entry) {
     $sandbox['progress']++;
 
-    if (REQUEST_TIME < $entry->expires) {
-      $key_value_expirable->setWithExpire($entry->token, $entry->video_id, $entry->expires - REQUEST_TIME);
+    if (\Drupal::time()->getRequestTime() < $entry->expires) {
+      $key_value_expirable->setWithExpire($entry->token, $entry->video_id, $entry->expires - \Drupal::time()->getRequestTime());
     }
   }
 
@@ -221,9 +221,6 @@ function brightcove_update_8105() {
   $entity_type_definition = $entity_type_manager->getDefinition('brightcove_video');
   $schema->changeField($entity_type_definition->getBaseTable(), 'name', 'name', $name_column_specifications);
   $entity_definition_update_manager->installEntityType($entity_type_definition);
-
-  // Apply entity definition updates.
-  \Drupal::entityDefinitionUpdateManager()->applyUpdates();
 }
 
 /**
diff --git a/brightcove.module b/brightcove.module
index 7694afa..795eae7 100644
--- a/brightcove.module
+++ b/brightcove.module
@@ -322,7 +322,7 @@ function brightcove_theme_suggestions_brightcove_video_alter(array &$suggestions
  */
 function brightcove_entity_access(EntityInterface $entity, $operation, AccountInterface $account) {
   // Disable editing/deleting video tags.
-  if (($entity instanceof TermInterface && $entity->getVocabularyId() == BrightcoveVideo::TAGS_VID || $entity instanceof VocabularyInterface && $entity->id() == BrightcoveVideo::TAGS_VID) && ($operation == 'update' || $operation == 'delete')) {
+  if (($entity instanceof TermInterface && $entity->bundle() == BrightcoveVideo::TAGS_VID || $entity instanceof VocabularyInterface && $entity->id() == BrightcoveVideo::TAGS_VID) && ($operation == 'update' || $operation == 'delete')) {
     return AccessResult::forbidden();
   }
   return AccessResult::neutral();
diff --git a/src/BrightcovePlaylistListBuilder.php b/src/BrightcovePlaylistListBuilder.php
index 45cabcf..f4ee63b 100644
--- a/src/BrightcovePlaylistListBuilder.php
+++ b/src/BrightcovePlaylistListBuilder.php
@@ -7,7 +7,7 @@ use Drupal\Core\Entity\EntityInterface;
 use Drupal\Core\Entity\EntityListBuilder;
 use Drupal\Core\Entity\EntityStorageInterface;
 use Drupal\Core\Entity\EntityTypeInterface;
-use Drupal\Core\Routing\LinkGeneratorTrait;
+use Drupal\Core\Link;
 use Drupal\Core\Session\AccountProxy;
 use Drupal\Core\Url;
 use Symfony\Component\DependencyInjection\ContainerInterface;
@@ -18,7 +18,6 @@ use Symfony\Component\DependencyInjection\ContainerInterface;
  * @ingroup brightcove
  */
 class BrightcovePlaylistListBuilder extends EntityListBuilder {
-  use LinkGeneratorTrait;
 
   /**
    * Account proxy.
@@ -103,7 +102,7 @@ class BrightcovePlaylistListBuilder extends EntityListBuilder {
   public function buildRow(EntityInterface $entity) {
     /* @var $entity \Drupal\brightcove\Entity\BrightcovePlaylist */
     if (($entity->isPublished() && $this->accountProxy->hasPermission('view published brightcove playlists')) || (!$entity->isPublished() && $this->accountProxy->hasPermission('view unpublished brightcove playlists'))) {
-      $name = $this->l(
+      $name = Link::fromTextAndUrl(
         $entity->label(),
         new Url(
           'entity.brightcove_playlist.canonical', [
diff --git a/src/BrightcoveUtil.php b/src/BrightcoveUtil.php
index 12dc98c..e543204 100644
--- a/src/BrightcoveUtil.php
+++ b/src/BrightcoveUtil.php
@@ -195,30 +195,30 @@ class BrightcoveUtil {
           if ($entity->getChangedTime() < strtotime($cms_entity->getUpdatedAt())) {
             $url = Url::fromRoute("brightcove_manual_update_{$entity_type}", ['entity_id' => $entity->id()], ['query' => ['token' => \Drupal::getContainer()->get('csrf_token')->get("brightcove_{$entity_type}/{$entity->id()}/update")]]);
 
-            drupal_set_message(t("There is a newer version of this :type on Brightcove, you may want to <a href=':url'>update the local version</a> before editing it.", [
+            \Drupal::messenger()->addWarning(t("There is a newer version of this :type on Brightcove, you may want to <a href=':url'>update the local version</a> before editing it.", [
               ':type' => $entity_type,
               ':url' => $url->toString(),
-            ]), 'warning');
+            ]));
           }
         }
       }
       catch (APIException $e) {
         if (!empty($entity_type)) {
           $url = Url::fromRoute("entity.brightcove_{$entity_type}.delete_form", ["brightcove_{$entity_type}" => $entity->id()]);
-          drupal_set_message(t("This :type no longer exists on Brightcove. You may want to <a href=':url'>delete the local version</a> too.", [
+          \Drupal::messenger()->addError(t("This :type no longer exists on Brightcove. You may want to <a href=':url'>delete the local version</a> too.", [
             ':type' => $entity_type,
             ':url' => $url->toString(),
-          ]), 'error');
+          ]));
         }
         else {
-          drupal_set_message($e->getMessage(), 'error');
+          \Drupal::messenger()->addError($e->getMessage());
         }
       }
     }
     else {
-      drupal_set_message(t('Brightcove API connection error: :error', [
+      \Drupal::messenger()->addError(t('Brightcove API connection error: :error', [
         ':error' => self::getApiClient($entity->getApiClient())->getClientStatusMessage(),
-      ]), 'error');
+      ]));
     }
   }
 
diff --git a/src/BrightcoveVideoListBuilder.php b/src/BrightcoveVideoListBuilder.php
index 5628724..69c400f 100644
--- a/src/BrightcoveVideoListBuilder.php
+++ b/src/BrightcoveVideoListBuilder.php
@@ -7,7 +7,7 @@ use Drupal\Core\Entity\EntityInterface;
 use Drupal\Core\Entity\EntityListBuilder;
 use Drupal\Core\Entity\EntityStorageInterface;
 use Drupal\Core\Entity\EntityTypeInterface;
-use Drupal\Core\Routing\LinkGeneratorTrait;
+use Drupal\Core\Link;
 use Drupal\Core\Session\AccountProxy;
 use Drupal\Core\Url;
 use Drupal\file\Entity\File;
@@ -20,7 +20,6 @@ use Symfony\Component\DependencyInjection\ContainerInterface;
  * @ingroup brightcove
  */
 class BrightcoveVideoListBuilder extends EntityListBuilder {
-  use LinkGeneratorTrait;
 
   /**
    * Account proxy.
@@ -108,7 +107,7 @@ class BrightcoveVideoListBuilder extends EntityListBuilder {
   public function buildRow(EntityInterface $entity) {
     /* @var $entity \Drupal\brightcove\Entity\BrightcoveVideo */
     if (($entity->isPublished() && $this->accountProxy->hasPermission('view published brightcove videos')) || (!$entity->isPublished() && $this->accountProxy->hasPermission('view unpublished brightcove videos'))) {
-      $name = $this->l(
+      $name = Link::fromTextAndUrl(
         $entity->label(),
         new Url(
           'entity.brightcove_video.canonical', [
diff --git a/src/Controller/BrightcoveSubscriptionController.php b/src/Controller/BrightcoveSubscriptionController.php
index 0ce3c2d..1533946 100644
--- a/src/Controller/BrightcoveSubscriptionController.php
+++ b/src/Controller/BrightcoveSubscriptionController.php
@@ -189,7 +189,7 @@ class BrightcoveSubscriptionController extends ControllerBase {
         }
 
         if (!$warning_set && !$subscription_found) {
-          drupal_set_message($this->t('There are subscriptions which are not available on Brightcove.<br>You can either <strong>create</strong> them on Brightcove or <strong>delete</strong> them if no longer needed.'), 'warning');
+          $this->messenger()->addWarning($this->t('There are subscriptions which are not available on Brightcove.<br>You can either <strong>create</strong> them on Brightcove or <strong>delete</strong> them if no longer needed.'));
           $warning_set = TRUE;
         }
 
@@ -232,10 +232,10 @@ class BrightcoveSubscriptionController extends ControllerBase {
       }
     }
     if (!empty($api_clients_without_default_subscription)) {
-      drupal_set_message($this->t('There are missing default subscription(s) for the following API Client(s): %api_clients<br><a href="@link">Create missing subscription(s)</a>.', [
+      $this->messenger()->addWarning($this->t('There are missing default subscription(s) for the following API Client(s): %api_clients<br><a href="@link">Create missing subscription(s)</a>.', [
         '%api_clients' => implode(', ', $api_clients_without_default_subscription),
         '@link' => Url::fromRoute('entity.brightcove_subscription.create_defaults')->toString(),
-      ]), 'warning');
+      ]));
     }
 
     $page['subscriptions'] = [
@@ -264,7 +264,7 @@ class BrightcoveSubscriptionController extends ControllerBase {
       $brightcove_subscription->saveToBrightcove();
     }
     catch (BrightcoveSubscriptionException $e) {
-      drupal_set_message($this->t('Failed to create Subscription on Brightcove: @error', ['@error' => $e->getMessage()]), 'error');
+      $this->messenger()->addError($this->t('Failed to create Subscription on Brightcove: @error', ['@error' => $e->getMessage()]));
     }
 
     return $this->redirect('entity.brightcove_subscription.list');
@@ -284,10 +284,10 @@ class BrightcoveSubscriptionController extends ControllerBase {
     try {
       $subscription = BrightcoveSubscription::load($id);
       $subscription->saveToBrightcove();
-      drupal_set_message($this->t('Default subscription for the "@api_client" API client has been successfully enabled.', ['@api_client' => $subscription->getApiClient()->label()]));
+      $this->messenger()->addMessage($this->t('Default subscription for the "@api_client" API client has been successfully enabled.', ['@api_client' => $subscription->getApiClient()->label()]));
     }
     catch (\Exception $e) {
-      drupal_set_message($this->t('Failed to enable the default subscription: @error', ['@error' => $e->getMessage()]), 'error');
+      $this->messenger()->addError($this->t('Failed to enable the default subscription: @error', ['@error' => $e->getMessage()]));
     }
     return $this->redirect('entity.brightcove_subscription.list');
   }
@@ -306,10 +306,10 @@ class BrightcoveSubscriptionController extends ControllerBase {
     try {
       $subscription = BrightcoveSubscription::load($id);
       $subscription->deleteFromBrightcove();
-      drupal_set_message($this->t('Default subscription for the "@api_client" API client has been successfully disabled.', ['@api_client' => $subscription->getApiClient()->label()]));
+      $this->messenger()->addMessage($this->t('Default subscription for the "@api_client" API client has been successfully disabled.', ['@api_client' => $subscription->getApiClient()->label()]));
     }
     catch (\Exception $e) {
-      drupal_set_message($this->t('Failed to disable the default subscription: @error', ['@error' => $e->getMessage()]), 'error');
+      $this->messenger()->addError($this->t('Failed to disable the default subscription: @error', ['@error' => $e->getMessage()]));
     }
     return $this->redirect('entity.brightcove_subscription.list');
   }
@@ -376,10 +376,10 @@ class BrightcoveSubscriptionController extends ControllerBase {
         }
       }
 
-      drupal_set_message($this->t('Default subscriptions has been successfully created.'));
+      $this->messenger()->addMessage($this->t('Default subscriptions has been successfully created.'));
     }
     catch (\Exception $e) {
-      drupal_set_message($this->t('Failed to create default subscription(s), @error', ['@error' => $e->getMessage()]), 'error');
+      $this->messenger()->addError($this->t('Failed to create default subscription(s), @error', ['@error' => $e->getMessage()]));
       watchdog_exception('brightcove', $e, 'Failed to create default subscription(s), @error', ['@error' => $e->getMessage()]);
     }
 
diff --git a/src/Entity/BrightcoveVideo.php b/src/Entity/BrightcoveVideo.php
index a0e6db2..6fb0c89 100644
--- a/src/Entity/BrightcoveVideo.php
+++ b/src/Entity/BrightcoveVideo.php
@@ -26,6 +26,7 @@ use Drupal\file\Entity\File;
 use Drupal\link\LinkItemInterface;
 use Drupal\taxonomy\Entity\Term;
 use Drupal\time_formatter\Plugin\Field\FieldFormatter\TimeFieldFormatter;
+use Drupal\Core\File\FileSystemInterface;
 
 /**
  * Defines the Brightcove Video entity.
@@ -169,7 +170,7 @@ class BrightcoveVideo extends BrightcoveVideoPlaylistCmsEntity implements Bright
       if ($needs_save) {
         $image_content = file_get_contents($img_src);
         // Prepare directory and if it was a success try to save the image.
-        if (file_prepare_directory($image_dir, FILE_MODIFY_PERMISSIONS | FILE_CREATE_DIRECTORY)) {
+        if (\Drupal::service('file_system')->prepareDirectory($image_dir, FileSystemInterface::MODIFY_PERMISSIONS | FileSystemInterface::CREATE_DIRECTORY)) {
           $image_name = $matches[1];
           $file = file_save_data($image_content, "{$image_dir}/{$image_name}");
 
@@ -921,13 +922,13 @@ class BrightcoveVideo extends BrightcoveVideoPlaylistCmsEntity implements Bright
       }
       catch (APIException $e) {
         if ($e->getCode() == 404) {
-          drupal_set_message(t('The video was not found on Brightcove, only the local version was deleted.'), 'warning');
+          \Drupal::messenger()->addWarning(t('The video was not found on Brightcove, only the local version was deleted.'));
           parent::delete();
         }
         else {
-          drupal_set_message(t('There was an error while trying to delete the Video from Brightcove: @error', [
+          \Drupal::messenger()->addError(t('There was an error while trying to delete the Video from Brightcove: @error', [
             '@error' => ($e->getMessage()),
-          ]), 'error');
+          ]));
         }
       }
     }
diff --git a/src/Form/BrightcoveAPIClientDeleteForm.php b/src/Form/BrightcoveAPIClientDeleteForm.php
index 3f32d12..f33b0c8 100644
--- a/src/Form/BrightcoveAPIClientDeleteForm.php
+++ b/src/Form/BrightcoveAPIClientDeleteForm.php
@@ -250,7 +250,7 @@ class BrightcoveAPIClientDeleteForm extends EntityConfirmFormBase {
 
     // Delete api client.
     $entity->delete();
-    drupal_set_message($this->t('Entity @type: deleted @label.', [
+    $this->messenger()->addMessage($this->t('Entity @type: deleted @label.', [
       '@type' => $this->entity->bundle(),
       '@label' => $this->entity->label(),
     ]));
diff --git a/src/Form/BrightcoveAPIClientForm.php b/src/Form/BrightcoveAPIClientForm.php
index 86113ca..19c55b3 100644
--- a/src/Form/BrightcoveAPIClientForm.php
+++ b/src/Form/BrightcoveAPIClientForm.php
@@ -317,7 +317,7 @@ class BrightcoveAPIClientForm extends EntityForm {
 
     switch ($status) {
       case SAVED_NEW:
-        drupal_set_message($this->t('Created the %label Brightcove API Client.', [
+        $this->messenger()->addMessage($this->t('Created the %label Brightcove API Client.', [
           '%label' => $brightcove_api_client->label(),
         ]));
 
@@ -341,7 +341,7 @@ class BrightcoveAPIClientForm extends EntityForm {
         break;
 
       default:
-        drupal_set_message($this->t('Saved the %label Brightcove API Client.', [
+        $this->messenger()->addMessage($this->t('Saved the %label Brightcove API Client.', [
           '%label' => $brightcove_api_client->label(),
         ]));
     }
@@ -350,7 +350,7 @@ class BrightcoveAPIClientForm extends EntityForm {
       $this->config->set('defaultAPIClient', $brightcove_api_client->id())->save();
     }
 
-    $form_state->setRedirectUrl($brightcove_api_client->urlInfo('collection'));
+    $form_state->setRedirectUrl($brightcove_api_client->toUrl('collection')->toString());
   }
 
 }
diff --git a/src/Form/BrightcovePlaylistForm.php b/src/Form/BrightcovePlaylistForm.php
index 05b9baa..b10d9b4 100644
--- a/src/Form/BrightcovePlaylistForm.php
+++ b/src/Form/BrightcovePlaylistForm.php
@@ -105,20 +105,20 @@ class BrightcovePlaylistForm extends BrightcoveVideoPlaylistForm {
 
       switch ($status) {
         case SAVED_NEW:
-          drupal_set_message($this->t('Created the %label Brightcove Playlist.', [
+          $this->messenger()->addMessage($this->t('Created the %label Brightcove Playlist.', [
             '%label' => $entity->label(),
           ]));
           break;
 
         default:
-          drupal_set_message($this->t('Saved the %label Brightcove Playlist.', [
+          $this->messenger()->addMessage($this->t('Saved the %label Brightcove Playlist.', [
             '%label' => $entity->label(),
           ]));
       }
       $form_state->setRedirect('entity.brightcove_playlist.canonical', ['brightcove_playlist' => $entity->id()]);
     }
     catch (APIException $e) {
-      drupal_set_message($e->getMessage(), 'error');
+      $this->messenger()->addError($e->getMessage());
     }
   }
 
diff --git a/src/Form/BrightcoveSubscriptionDeleteForm.php b/src/Form/BrightcoveSubscriptionDeleteForm.php
index 3b2a349..d38260e 100644
--- a/src/Form/BrightcoveSubscriptionDeleteForm.php
+++ b/src/Form/BrightcoveSubscriptionDeleteForm.php
@@ -61,7 +61,7 @@ class BrightcoveSubscriptionDeleteForm extends ConfirmFormBase {
   public function buildForm(array $form, FormStateInterface $form_state) {
     // Prevent deletion of the default Subscription entity.
     if (!empty($this->brightcoveSubscription) && $this->brightcoveSubscription->isDefault()) {
-      drupal_set_message($this->t('The API client default Subscription cannot be deleted.'), 'error');
+      $this->messenger()->addError($this->t('The API client default Subscription cannot be deleted.'));
       return $this->redirect('entity.brightcove_subscription.list');
     }
 
@@ -76,10 +76,10 @@ class BrightcoveSubscriptionDeleteForm extends ConfirmFormBase {
       $this->brightcoveSubscription->delete(FALSE);
     }
     catch (APIException $e) {
-      drupal_set_message($e->getMessage(), 'error');
+      $this->messenger()->addError($e->getMessage());
     }
 
-    drupal_set_message($this->t('Subscription has been successfully deleted.'));
+    $this->messenger()->addMessage($this->t('Subscription has been successfully deleted.'));
     $form_state->setRedirect('entity.brightcove_subscription.list');
   }
 
diff --git a/src/Form/BrightcoveSubscriptionForm.php b/src/Form/BrightcoveSubscriptionForm.php
index 1ce5f43..1481c9e 100644
--- a/src/Form/BrightcoveSubscriptionForm.php
+++ b/src/Form/BrightcoveSubscriptionForm.php
@@ -95,17 +95,17 @@ class BrightcoveSubscriptionForm extends FormBase {
       ]);
       $brightcove_subscription->save(TRUE);
 
-      drupal_set_message($this->t('Created Brightcove Subscription with %endpoint endpoint.', [
+      $this->messenger()->addMessage($this->t('Created Brightcove Subscription with %endpoint endpoint.', [
         '%endpoint' => $brightcove_subscription->getEndpoint(),
       ]));
     }
     catch (\Exception $e) {
       // In case of an exception, show an error message and rebuild the form.
       if ($e->getMessage()) {
-        drupal_set_message($this->t('Failed to create subscription: %error', ['%error' => $e->getMessage()]), 'error');
+        $this->messenger()->addError($this->t('Failed to create subscription: %error', ['%error' => $e->getMessage()]));
       }
       else {
-        drupal_set_message($this->t('Failed to create subscription.'), 'error');
+        $this->messenger()->addError($this->t('Failed to create subscription.'));
       }
 
       $form_state->setRebuild(TRUE);
diff --git a/src/Form/BrightcoveTextTrackForm.php b/src/Form/BrightcoveTextTrackForm.php
index a25da09..5851d0c 100644
--- a/src/Form/BrightcoveTextTrackForm.php
+++ b/src/Form/BrightcoveTextTrackForm.php
@@ -30,13 +30,13 @@ class BrightcoveTextTrackForm extends ContentEntityForm {
 
     switch ($status) {
       case SAVED_NEW:
-        drupal_set_message($this->t('Created the %label Brightcove Text Track.', [
+        $this->messenger()->addMessage($this->t('Created the %label Brightcove Text Track.', [
           '%label' => $entity->label(),
         ]));
         break;
 
       default:
-        drupal_set_message($this->t('Saved the %label Brightcove Text Track.', [
+        $this->messenger()->addMessage($this->t('Saved the %label Brightcove Text Track.', [
           '%label' => $entity->label(),
         ]));
     }
diff --git a/src/Form/BrightcoveVideoForm.php b/src/Form/BrightcoveVideoForm.php
index ee165ef..91ce955 100644
--- a/src/Form/BrightcoveVideoForm.php
+++ b/src/Form/BrightcoveVideoForm.php
@@ -262,20 +262,20 @@ class BrightcoveVideoForm extends BrightcoveVideoPlaylistForm {
 
       switch ($status) {
         case SAVED_NEW:
-          drupal_set_message($this->t('Created the %label Brightcove Video.', [
+          $this->messenger()->addMessage($this->t('Created the %label Brightcove Video.', [
             '%label' => $entity->label(),
           ]));
           break;
 
         default:
-          drupal_set_message($this->t('Saved the %label Brightcove Video.', [
+          $this->messenger()->addMessage($this->t('Saved the %label Brightcove Video.', [
             '%label' => $entity->label(),
           ]));
       }
       $form_state->setRedirect('entity.brightcove_video.canonical', ['brightcove_video' => $entity->id()]);
     }
     catch (APIException $e) {
-      drupal_set_message($e->getMessage(), 'error');
+      $this->messenger()->addError($e->getMessage());
     }
   }
 
