diff --git a/core/modules/comment/comment.module b/core/modules/comment/comment.module
index 604cb93..ef12119 100644
--- a/core/modules/comment/comment.module
+++ b/core/modules/comment/comment.module
@@ -915,7 +915,7 @@ function comment_links(Comment $comment, EntityInterface $node) {
   }
 
   // Add translations link for translation-enabled comment bundles.
-  if (module_exists('content_translation') && content_translation_translate_access($comment)) {
+  if (Drupal::moduleHandler()->moduleExists('content_translation') && content_translation_translate_access($comment)) {
     $links['comment-translations'] = array(
       'title' => t('translate'),
       'href' => 'comment/' . $comment->id() . '/translations',
@@ -1021,7 +1021,7 @@ function comment_form_node_type_form_alter(&$form, $form_state) {
       ),
     );
     // @todo Remove this check once language settings are generalized.
-    if (module_exists('content_translation')) {
+    if (Drupal::moduleHandler()->moduleExists('content_translation')) {
       $comment_form = $form;
       $comment_form_state['content_translation']['key'] = 'language_configuration';
       $form['comment'] += content_translation_enable_widget('comment', 'comment_node_' . $node_type->id(), $comment_form, $comment_form_state);
@@ -1325,7 +1325,7 @@ function comment_load($cid, $reset = FALSE) {
 function comment_num_new($nid, $timestamp = 0) {
   global $user;
 
-  if ($user->uid && module_exists('history')) {
+  if ($user->uid && Drupal::moduleHandler()->moduleExists('history')) {
     // Retrieve the timestamp at which the current user last viewed this node.
     if (!$timestamp) {
       $timestamp = history_read($nid);
diff --git a/core/modules/comment/lib/Drupal/comment/Plugin/views/field/NcsLastCommentName.php b/core/modules/comment/lib/Drupal/comment/Plugin/views/field/NcsLastCommentName.php
index 4417cfb..1afec6f 100644
--- a/core/modules/comment/lib/Drupal/comment/Plugin/views/field/NcsLastCommentName.php
+++ b/core/modules/comment/lib/Drupal/comment/Plugin/views/field/NcsLastCommentName.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\comment\Plugin\views\field;
 
+use Drupal\views\Plugin\views\PluginBase;
 use Drupal\views\Plugin\views\field\FieldPluginBase;
 use Drupal\Component\Annotation\PluginID;
 
@@ -37,7 +38,7 @@ public function query() {
         )
       )
     );
-    $join = drupal_container()->get('plugin.manager.views.join')->createInstance('standard', $definition);
+    $join = \Drupal::service('plugin.manager.views.join')->createInstance('standard', $definition);
 
     // ncs_user alias so this can work with the sort handler, below.
     $this->user_table = $this->query->ensureTable('ncs_users', $this->relationship, $join);
diff --git a/core/modules/comment/lib/Drupal/comment/Plugin/views/sort/NcsLastCommentName.php b/core/modules/comment/lib/Drupal/comment/Plugin/views/sort/NcsLastCommentName.php
index f87203d..b430a3f 100644
--- a/core/modules/comment/lib/Drupal/comment/Plugin/views/sort/NcsLastCommentName.php
+++ b/core/modules/comment/lib/Drupal/comment/Plugin/views/sort/NcsLastCommentName.php
@@ -28,7 +28,7 @@ public function query() {
       'left_table' => $this->tableAlias,
       'left_field' => 'last_comment_uid',
     );
-    $join = drupal_container()->get('plugin.manager.views.join')->createInstance('standard', $definition);
+    $join = \Drupal::service('plugin.manager.views.join')->createInstance('standard', $definition);
 
     // @todo this might be safer if we had an ensure_relationship rather than guessing
     // the table alias. Though if we did that we'd be guessing the relationship name
