diff --git a/diff.services.yml b/diff.services.yml
index c368b92..b670e5f 100755
--- a/diff.services.yml
+++ b/diff.services.yml
@@ -31,6 +31,6 @@ services:
 
   theme.negotiator.visual_diff:
     class: Drupal\diff\VisualDiffThemeNegotiator
-    arguments: ['@current_user', '@config.factory', '@entity.manager', '@router.admin_context']
+    arguments: ['@config.factory']
     tags:
       - { name: theme_negotiator, priority: 0 }
diff --git a/src/VisualDiffThemeNegotiator.php b/src/VisualDiffThemeNegotiator.php
index 7fa4534..e5678c4 100644
--- a/src/VisualDiffThemeNegotiator.php
+++ b/src/VisualDiffThemeNegotiator.php
@@ -2,29 +2,51 @@
 
 namespace Drupal\diff;
 
+use Drupal\Core\Config\ConfigFactoryInterface;
 use Drupal\Core\Routing\RouteMatchInterface;
-use Drupal\user\Theme\AdminNegotiator;
+use Drupal\Core\Theme\ThemeNegotiatorInterface;
 
 /**
  * Visual inline layout theme negotiator.
  *
  * @package Drupal\diff
  */
-class VisualDiffThemeNegotiator extends AdminNegotiator {
+class VisualDiffThemeNegotiator implements ThemeNegotiatorInterface {
+
+  /**
+   * The config factory.
+   *
+   * @var \Drupal\Core\Config\ConfigFactoryInterface
+   */
+  protected $configFactory;
+
+  /**
+   * VisualDiffThemeNegotiator constructor.
+   *
+   * @param \Drupal\Core\Config\ConfigFactoryInterface $config_factory
+   *   The config factory.
+   */
+  public function __construct(ConfigFactoryInterface $config_factory) {
+    $this->configFactory = $config_factory;
+  }
 
   /**
    * {@inheritdoc}
    */
   public function applies(RouteMatchInterface $routeMatch) {
-    if ($routeMatch->getParameter('filter') === 'visual_inline') {
-      if ($this->isDiffRoute($routeMatch)) {
-        if ($this->configFactory->get('diff.settings')->get('general_settings.visual_inline_theme') === 'default') {
-          return TRUE;
-        }
-      }
+    if ($routeMatch->getParameter('filter') !== 'visual_inline') {
+      return FALSE;
+    }
+
+    if (!$this->isDiffRoute($routeMatch)) {
+      return FALSE;
     }
 
-    return FALSE;
+    if ($this->configFactory->get('diff.settings')->get('general_settings.visual_inline_theme') !== 'default') {
+      return FALSE;
+    }
+
+    return TRUE;
   }
 
   /**
@@ -43,9 +65,10 @@ public function determineActiveTheme(RouteMatchInterface $route_match) {
    * @return bool
    *   Return TRUE if route name is ok.
    */
-  public function isDiffRoute(RouteMatchInterface $route_match) {
+  protected function isDiffRoute(RouteMatchInterface $route_match) {
     $regex_pattern = '/^entity\..*\.revisions_diff$/';
     return $route_match->getRouteName() === 'diff.revisions_diff' ||
       preg_match($regex_pattern, $route_match->getRouteName());
   }
+
 }
diff --git a/tests/src/Unit/VisualDiffThemeNegotiatorTest.php b/tests/src/Unit/VisualDiffThemeNegotiatorTest.php
index 87d4da0..9348ff8 100644
--- a/tests/src/Unit/VisualDiffThemeNegotiatorTest.php
+++ b/tests/src/Unit/VisualDiffThemeNegotiatorTest.php
@@ -4,13 +4,9 @@
 
 use Drupal\Core\Config\ConfigFactoryInterface;
 use Drupal\Core\Config\ImmutableConfig;
-use Drupal\Core\Entity\EntityManagerInterface;
-use Drupal\Core\Routing\AdminContext;
 use Drupal\Core\Routing\RouteMatchInterface;
-use Drupal\Core\Session\AccountInterface;
 use Drupal\diff\VisualDiffThemeNegotiator;
 use Drupal\Tests\UnitTestCase;
-use Symfony\Component\DependencyInjection\ContainerInterface;
 
 /**
  * Class VisualDiffThemeNegotiatorTest
@@ -21,75 +17,107 @@
 class VisualDiffThemeNegotiatorTest extends UnitTestCase {
 
   /**
-   * The current user.
-   *
-   * @var \Drupal\Core\Session\AccountInterface
-   */
-  protected $user;
-
-  /**
    * The config factory.
    *
-   * @var \Drupal\Core\Config\ConfigFactoryInterface
+   * @var \Drupal\Core\Config\ConfigFactoryInterface|\Prophecy\Prophecy\ProphecyInterface
    */
   protected $configFactory;
 
   /**
-   * The entity manager.
+   * The class under test.
    *
-   * @var \Drupal\Core\Entity\EntityManagerInterface
+   * @var \Drupal\diff\VisualDiffThemeNegotiator
    */
-  protected $entityManager;
-
-  /**
-   * The route admin context to determine whether a route is an admin one.
-   *
-   * @var \Drupal\Core\Routing\AdminContext
-   */
-  protected $adminContext;
+  protected $themeNegotiator;
 
   /**
    * {@inheritdoc}
    */
   protected function setUp() {
     parent::setUp();
-    $this->user = $this->prophesize(AccountInterface::class);
+
     $this->configFactory = $this->prophesize(ConfigFactoryInterface::class);
-    $this->entityManager = $this->prophesize(EntityManagerInterface::class);
-    $this->adminContext = $this->prophesize(AdminContext::class);
+    $this->themeNegotiator = new VisualDiffThemeNegotiator($this->configFactory->reveal());
   }
 
   /**
-   * Tests if applies method returns true.
-   *
-   * Check the value returned by the applies method when the theme used for
-   * visual inline plugin is "Standard".
+   * @covers ::determineActiveTheme
    */
-  public function testNegotiator() {
-    // Create $theme using mocked class.
-    $theme = new VisualDiffThemeNegotiator($this->user->reveal(),
-      $this->configFactory->reveal(),
-      $this->entityManager->reveal(),
-      $this->adminContext->reveal());
+  public function testDetermineActiveTheme() {
+    $config = $this->prophesize(ImmutableConfig::class);
+    $config->get('default')->willReturn('the_default_theme');
+    $this->configFactory->get('system.theme')->willReturn($config->reveal());
 
-    // Mocking $route_match and relevant variable.
     $route_match = $this->prophesize(RouteMatchInterface::class);
-    $route_match->getRouteName()->willReturn('diff.revisions_diff');
-    $this->assertTrue($theme->isDiffRoute($route_match->reveal()));
-    $route_match->getRouteName()->willReturn('entity.entity_type_id.revisions_diff');
-    $this->assertTrue($theme->isDiffRoute($route_match->reveal()));
-    $route_match->getParameter('filter')->willReturn('visual_inline');
+    $result = $this->themeNegotiator->determineActiveTheme($route_match->reveal());
+    $this->assertSame('the_default_theme', $result);
+  }
 
-    $container = $this->prophesize(ContainerInterface::class);
-    $container->get('config.factory')->willReturn($this->configFactory);
-    $diff_config = $this->prophesize(ImmutableConfig::class);
-    $this->configFactory->get('diff.settings')
-      ->willReturn($diff_config->reveal());
-    $diff_config->get('general_settings.visual_inline_theme')->willReturn('default');
-    \Drupal::setContainer($container->reveal());
+  /**
+   * @covers ::applies
+   * @covers ::isDiffRoute
+   *
+   * @dataProvider providerTestApplies
+   */
+  public function testApplies($filter_parameter, $route_name, $config_value, $expected) {
+    $route_match = $this->prophesize(RouteMatchInterface::class);
+    $route_match->getParameter('filter')->willReturn($filter_parameter);
+
+    if ($route_name) {
+      $route_match->getRouteName()->willReturn($route_name);
+    }
+    else {
+      $route_match->getRouteName()->shouldNotBeCalled();
+    }
 
-    // Check if applies function returns true.
-    $this->assertTrue($theme->applies($route_match->reveal()));
+    if ($config_value) {
+      $diff_config = $this->prophesize(ImmutableConfig::class);
+      $diff_config->get('general_settings.visual_inline_theme')->willReturn($config_value);
+      $this->configFactory->get('diff.settings')->willReturn($diff_config->reveal());
+    }
+    else {
+      $this->configFactory->get('diff.settings')->shouldNotBeCalled();
+    }
+
+    $this->assertSame($expected, $this->themeNegotiator->applies($route_match->reveal()));
+  }
+
+  /**
+   * Provides test data to ::testApplies().
+   */
+  public function providerTestApplies() {
+    $data = [];
+    $data[] = [
+      'unexpected_filter_parameter',
+      NULL,
+      NULL,
+      FALSE,
+    ];
+    $data[] = [
+      'visual_inline',
+      'unexpected_route_name',
+      NULL,
+      FALSE,
+    ];
+    $data[] = [
+      'visual_inline',
+      'diff.revisions_diff',
+      'unexpected_config_value',
+      FALSE,
+    ];
+    $data[] = [
+      'visual_inline',
+      'diff.revisions_diff',
+      'default',
+      TRUE,
+    ];
+    $data[] = [
+      'visual_inline',
+      'entity.foo.revisions_diff',
+      'default',
+      TRUE,
+    ];
+    return $data;
   }
 
 }
