diff --git a/brightcove.install b/brightcove.install
index 6c647d3..84a36c2 100644
--- a/brightcove.install
+++ b/brightcove.install
@@ -134,8 +134,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());
     }
   }
 
diff --git a/src/BrightcovePlaylistListBuilder.php b/src/BrightcovePlaylistListBuilder.php
index 45cabcf..b48c9f3 100644
--- a/src/BrightcovePlaylistListBuilder.php
+++ b/src/BrightcovePlaylistListBuilder.php
@@ -2,6 +2,7 @@
 
 namespace Drupal\brightcove;
 
+use Drupal\Core\Link;
 use Drupal\Core\Datetime\DateFormatter;
 use Drupal\Core\Entity\EntityInterface;
 use Drupal\Core\Entity\EntityListBuilder;
@@ -103,14 +104,13 @@ 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(
-        $entity->label(),
-        new Url(
-          'entity.brightcove_playlist.canonical', [
-            'brightcove_playlist' => $entity->id(),
-          ]
-        )
-      );
+      // TODO: Drupal Rector Notice: Please delete the following comment after you've made any necessary changes.
+      // Please manually remove the `use LinkGeneratorTrait;` statement from this class.
+      $name = Link::fromTextAndUrl($entity->label(), new Url(
+        'entity.brightcove_playlist.canonical', [
+          'brightcove_playlist' => $entity->id(),
+        ]
+      ));
     }
     else {
       $name = $entity->label();
diff --git a/src/BrightcoveUtil.php b/src/BrightcoveUtil.php
index 6bbae75..1a09b1e 100644
--- a/src/BrightcoveUtil.php
+++ b/src/BrightcoveUtil.php
@@ -196,30 +196,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..ddd2b7e 100644
--- a/src/BrightcoveVideoListBuilder.php
+++ b/src/BrightcoveVideoListBuilder.php
@@ -2,6 +2,7 @@
 
 namespace Drupal\brightcove;
 
+use Drupal\Core\Link;
 use Drupal\Core\Datetime\DateFormatter;
 use Drupal\Core\Entity\EntityInterface;
 use Drupal\Core\Entity\EntityListBuilder;
@@ -108,14 +109,13 @@ 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(
-        $entity->label(),
-        new Url(
-          'entity.brightcove_video.canonical', [
-            'brightcove_video' => $entity->id(),
-          ]
-        )
-      );
+      // TODO: Drupal Rector Notice: Please delete the following comment after you've made any necessary changes.
+      // Please manually remove the `use LinkGeneratorTrait;` statement from this class.
+      $name = Link::fromTextAndUrl($entity->label(), new Url(
+        'entity.brightcove_video.canonical', [
+          'brightcove_video' => $entity->id(),
+        ]
+      ));
     }
     else {
       $name = $entity->label();
diff --git a/src/Controller/BrightcoveSubscriptionController.php b/src/Controller/BrightcoveSubscriptionController.php
index 6132f66..f7b736b 100644
--- a/src/Controller/BrightcoveSubscriptionController.php
+++ b/src/Controller/BrightcoveSubscriptionController.php
@@ -205,7 +205,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;
         }
 
@@ -248,10 +248,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'] = [
@@ -280,7 +280,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');
@@ -300,10 +300,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()->addStatus($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');
   }
@@ -322,10 +322,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()->addStatus($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');
   }
@@ -392,10 +392,10 @@ class BrightcoveSubscriptionController extends ControllerBase {
         }
       }
 
-      drupal_set_message($this->t('Default subscriptions has been successfully created.'));
+      $this->messenger()->addStatus($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 99f5da2..39b90f2 100644
--- a/src/Entity/BrightcoveVideo.php
+++ b/src/Entity/BrightcoveVideo.php
@@ -2,6 +2,7 @@
 
 namespace Drupal\brightcove\Entity;
 
+use Drupal\Core\File\FileSystemInterface;
 use Brightcove\API\Exception\APIException;
 use Brightcove\API\Request\IngestImage;
 use Brightcove\API\Request\IngestRequest;
@@ -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..cc97b3f 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()->addStatus($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..d91c8bf 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()->addStatus($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()->addStatus($this->t('Saved the %label Brightcove API Client.', [
           '%label' => $brightcove_api_client->label(),
         ]));
     }
@@ -350,7 +350,9 @@ class BrightcoveAPIClientForm extends EntityForm {
       $this->config->set('defaultAPIClient', $brightcove_api_client->id())->save();
     }
 
-    $form_state->setRedirectUrl($brightcove_api_client->urlInfo('collection'));
+    // TODO: Drupal Rector Notice: Please delete the following comment after you've made any necessary changes.
+    // Please confirm that `$brightcove_api_client` is an instance of `Drupal\Core\Entity\EntityInterface`. Only the method name and not the class name was checked for this replacement, so this may be a false positive.
+    $form_state->setRedirectUrl($brightcove_api_client->toUrl('collection'));
   }
 
 }
diff --git a/src/Form/BrightcovePlaylistForm.php b/src/Form/BrightcovePlaylistForm.php
index 05b9baa..78fdcda 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()->addStatus($this->t('Created the %label Brightcove Playlist.', [
             '%label' => $entity->label(),
           ]));
           break;
 
         default:
-          drupal_set_message($this->t('Saved the %label Brightcove Playlist.', [
+          $this->messenger()->addStatus($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..92b84da 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()->addStatus($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..f0e57d0 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()->addStatus($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..34b9ba5 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()->addStatus($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()->addStatus($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..acb9d85 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()->addStatus($this->t('Created the %label Brightcove Video.', [
             '%label' => $entity->label(),
           ]));
           break;
 
         default:
-          drupal_set_message($this->t('Saved the %label Brightcove Video.', [
+          $this->messenger()->addStatus($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());
     }
   }
 
