diff --git a/core/modules/aggregator/aggregator.admin.inc b/core/modules/aggregator/aggregator.admin.inc
index f26d4ff..150f06f 100644
--- a/core/modules/aggregator/aggregator.admin.inc
+++ b/core/modules/aggregator/aggregator.admin.inc
@@ -6,6 +6,7 @@
  */
 
 use Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException;
+use Drupal;
 use Drupal\aggregator\Plugin\Core\Entity\Feed;
 
 /**
@@ -73,8 +74,8 @@ function aggregator_form_category_validate($form, &$form_state) {
 function aggregator_form_category_submit($form, &$form_state) {
   // @todo Replicate this cache invalidation when these ops are separated.
   // Invalidate the block cache to update aggregator category-based derivatives.
-  if (module_exists('block')) {
-    drupal_container()->get('plugin.manager.block')->clearCachedDefinitions();
+  if (Drupal::moduleHandler()->moduleExists('block')) {
+    Drupal::service('plugin.manager.block')->clearCachedDefinitions();
   }
   if ($form_state['values']['op'] == t('Delete')) {
     $title = $form_state['values']['title'];
diff --git a/core/modules/aggregator/lib/Drupal/aggregator/FeedStorageController.php b/core/modules/aggregator/lib/Drupal/aggregator/FeedStorageController.php
index 82a5643..3bf2239 100644
--- a/core/modules/aggregator/lib/Drupal/aggregator/FeedStorageController.php
+++ b/core/modules/aggregator/lib/Drupal/aggregator/FeedStorageController.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\aggregator;
 
+use Drupal;
 use Drupal\Core\Entity\DatabaseStorageControllerNG;
 use Drupal\Core\Entity\EntityInterface;
 
@@ -84,8 +85,8 @@ protected function preSave(EntityInterface $entity) {
     parent::preSave($entity);
 
     // Invalidate the block cache to update aggregator feed-based derivatives.
-    if (module_exists('block')) {
-      drupal_container()->get('plugin.manager.block')->clearCachedDefinitions();
+    if (Drupal::moduleHandler()->moduleExists('block')) {
+      Drupal::service('plugin.manager.block')->clearCachedDefinitions();
     }
     // An existing feed is being modified, delete the category listings.
     db_delete('aggregator_category_feed')
