diff --git a/admin_menu.module b/admin_menu.module
index 02c98f6..2a8b954 100644
--- a/admin_menu.module
+++ b/admin_menu.module
@@ -146,11 +146,11 @@ function admin_menu_system_info_alter(&$info, $file, $type) {
  * Implements hook_page_bottom().
  */
 function admin_menu_page_bottom(array &$page_bottom) {
-  if (!user_access('access administration menu') || admin_menu_suppress(FALSE)) {
+  if (!\Drupal::currentUser()->hasPermission('access administration menu') || admin_menu_suppress(FALSE)) {
     return;
   }
   // Performance: Skip this entirely for AJAX requests.
-  $current_path = current_path();
+  $current_path = \Drupal::request()->getRequestUri();
   if (strpos($current_path, 'js/') === 0) {
     return;
   }
@@ -179,7 +179,7 @@ function admin_menu_page_bottom(array &$page_bottom) {
 
   // Determine whether we need to show all components and disable all caches.
   $complete = FALSE;
-  if (current_path() == 'admin/config/admin/admin_menu' && $_SERVER['REQUEST_METHOD'] == 'GET') {
+  if (\Drupal::request()->getRequestUri() == 'admin/config/admin/admin_menu' && $_SERVER['REQUEST_METHOD'] == 'GET') {
     $complete = TRUE;
   }
 
diff --git a/admin_menu.services.yml b/admin_menu.services.yml
index 67cdbb6..3502a5c 100644
--- a/admin_menu.services.yml
+++ b/admin_menu.services.yml
@@ -3,6 +3,5 @@ services:
     class: Drupal\Core\Cache\CacheBackendInterface
     tags:
       - { name: cache.bin }
-    factory_method: get
-    factory_service: cache_factory
+    factory: cache_factory:get
     arguments: [admin_menu]
