diff --git a/diff.services.yml b/diff.services.yml
index 8fc61b1..e04e1dd 100755
--- a/diff.services.yml
+++ b/diff.services.yml
@@ -22,3 +22,7 @@ services:
     parent: system.breadcrumb.default
     tags:
       - { name: breadcrumb_builder, priority: 1000 }
+
+  diff.entity_comparison:
+    class: Drupal\diff\DiffEntityComparison
+    arguments: ['@config.factory', '@diff.diff.formatter','@plugin.manager.field.field_type', '@diff.entity_parser']
diff --git a/src/Controller/GenericRevisionController.php b/src/Controller/GenericRevisionController.php
index 3391dac..e8052a6 100644
--- a/src/Controller/GenericRevisionController.php
+++ b/src/Controller/GenericRevisionController.php
@@ -2,15 +2,69 @@
 
 namespace Drupal\diff\Controller;
 
+use Symfony\Component\DependencyInjection\ContainerInterface;
+use Drupal\Core\Controller\ControllerBase;
+use Drupal\Core\Datetime\DateFormatter;
+use Drupal\Component\Render\FormattableMarkup;
+use Drupal\diff\DiffEntityComparison;
 use Drupal\Component\Utility\Xss;
 use Drupal\Core\Entity\EntityInterface;
 use Drupal\Core\Entity\EntityStorageInterface;
 use Drupal\Core\Routing\RouteMatchInterface;
 use Drupal\Core\Url;
-use Drupal\diff\EntityComparisonBase;
 use Drupal\node\NodeInterface;
 
-class GenericRevisionController extends EntityComparisonBase {
+/**
+ * Base class for controllers that return responses on entity revision routes.
+ */
+class GenericRevisionController extends ControllerBase {
+
+  /**
+   * The date service.
+   *
+   * @var \Drupal\Core\Datetime\DateFormatter
+   */
+  protected $date;
+
+  /**
+   * Wrapper object for writing/reading configuration from diff.plugins.yml
+   */
+  protected $config;
+
+  /**
+   * Represents non breaking space HTML character entity marked as safe markup.
+   */
+  protected $nonBreakingSpace;
+
+  /**
+   * The diff entity comparison service.
+   */
+  protected $entityComparison;
+
+  /**
+   * Constructs a GenericRevisionController object.
+   *
+   * @param DateFormatter $date
+   *   DateFormatter service.
+   * @param DiffEntityComparison $entityComparison
+   *   DiffEntityComparison service.
+   */
+  public function __construct(DateFormatter $date, DiffEntityComparison $entityComparison) {
+    $this->date = $date;
+    $this->config = $this->config('diff.settings');
+    $this->nonBreakingSpace = new FormattableMarkup('&nbsp;', array());
+    $this->entityComparison = $entityComparison;
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public static function create(ContainerInterface $container) {
+    return new static(
+        $container->get('date.formatter'),
+        $container->get('diff.entity_comparison')
+    );
+  }
 
   /**
    * Get all the revision ids of given entity id.
@@ -38,7 +92,7 @@ class GenericRevisionController extends EntityComparisonBase {
    * @param \Drupal\Core\Routing\RouteMatchInterface $route_match
    *   The route match.
    * @param \Drupal\Core\Entity\EntityInterface $left_revision
-   *   The left revision
+   *   The left revision.
    * @param \Drupal\Core\Entity\EntityInterface $right_revision
    *   The right revision.
    * @param string $filter
@@ -87,7 +141,7 @@ class GenericRevisionController extends EntityComparisonBase {
 
     // Perform comparison only if both entity revisions loaded successfully.
     if ($left_revision != FALSE && $right_revision != FALSE) {
-      $fields = $this->compareRevisions($left_revision, $right_revision);
+      $fields = $this->entityComparison->compareRevisions($left_revision, $right_revision);
       // Build the diff rows for each field and append the field rows
       // to the table rows.
       foreach ($fields as $field) {
@@ -99,7 +153,7 @@ class GenericRevisionController extends EntityComparisonBase {
             'class' => array('field-name'),
           );
         }
-        $field_diff_rows = $this->getRows(
+        $field_diff_rows = $this->entityComparison->getRows(
           $field['#states'][$filter]['#left'],
           $field['#states'][$filter]['#right']
         );
@@ -193,12 +247,12 @@ class GenericRevisionController extends EntityComparisonBase {
           '#account' => $revision->uid->entity,
         );
         $revision_date = $this->date->format($revision->getRevisionCreationTime(), 'short');
-        $route_name = $entity_type_id != 'node' ? "entity.$entity_type_id.revisions_diff": 'entity.node.revision';
+        $route_name = $entity_type_id != 'node' ? "entity.$entity_type_id.revisions_diff" : 'entity.node.revision';
         $revision_link = $this->t($revision_log . '@date', array(
-            '@date' => $this->l($revision_date, Url::fromRoute($route_name, array(
-              $entity_type_id => $revision->id(),
-              $entity_type_id . '_revision' => $revision->getRevisionId(),
-          ))),
+          '@date' => $this->l($revision_date, Url::fromRoute($route_name, [
+            $entity_type_id => $revision->id(),
+            $entity_type_id . '_revision' => $revision->getRevisionId(),
+          ])),
         ));
       }
       else {
diff --git a/src/EntityComparisonBase.php b/src/DiffEntityComparison.php
similarity index 82%
rename from src/EntityComparisonBase.php
rename to src/DiffEntityComparison.php
index e104b55..8184326 100644
--- a/src/EntityComparisonBase.php
+++ b/src/DiffEntityComparison.php
@@ -2,43 +2,25 @@
 
 namespace Drupal\diff;
 
-use Symfony\Component\DependencyInjection\ContainerInterface;
+use Drupal\Core\Config\ConfigFactory;
 use Drupal\Component\Plugin\PluginManagerInterface;
 use Drupal\Core\Entity\ContentEntityInterface;
-use Drupal\Core\Controller\ControllerBase;
-use Drupal\Core\Render\Element;
 use Drupal\Component\Diff\Diff;
-use Drupal\Core\Datetime\DateFormatter;
-use Drupal\Component\Utility\Xss;
+use Drupal\Core\Render\Element;
 use Drupal\Core\Mail\MailFormatHelper;
-use Drupal\Component\Render\FormattableMarkup;
+use Drupal\Component\Utility\Xss;
 
 /**
- * Builds an array of data out of entity fields.
- *
- * The resulted data is then passed through the Diff component and
- * displayed on the UI and represents the differences between two entities.
+ * Entity comparison service that prepares a diff of a pair of entities.
  */
-class EntityComparisonBase extends ControllerBase {
+class DiffEntityComparison {
 
   /**
-   * DiffFormatter service.
+   * Contains the configuration object factory.
    *
-   * @var \Drupal\diff\DiffFormatter
+   * @var \Drupal\Core\Config\ConfigFactoryInterface
    */
-  protected $diffFormatter;
-
-  /**
-   * The date service.
-   *
-   * @var \Drupal\Core\Datetime\DateFormatter
-   */
-  protected $date;
-
-  /**
-   * Wrapper object for writing/reading simple configuration from diff.settings.yml
-   */
-  protected $config;
+  protected $configFactory;
 
   /**
    * Wrapper object for writing/reading simple configuration from diff.plugins.yml
@@ -46,61 +28,51 @@ class EntityComparisonBase extends ControllerBase {
   protected $pluginsConfig;
 
   /**
-   * A list of all the field types from the system and their definitions.
+   * The diff formatter.
+   *
+   * @var \Drupal\Core\Diff\DiffFormatter
    */
-  protected $fieldTypeDefinitions;
+  protected $diffFormatter;
 
   /**
-   * Represents non breaking space HTML character entity marked as safe markup.
+   * A list of all the field types from the system and their definitions.
    */
-  protected $nonBreakingSpace;
+  protected $fieldTypeDefinitions;
 
   /**
-   * The entity parser service for diff.
+   * The entity parser.
+   *
+   * @var \Drupal\diff\DiffEntityParser
    */
   protected $entityParser;
 
   /**
-   * Constructs an EntityComparisonBase object.
+   * Constructs a DiffEntityComparison object.
    *
+   * @param ConfigFactory $config_factory
+   *   Diff formatter service.
    * @param DiffFormatter $diff_formatter
    *   Diff formatter service.
-   * @param DateFormatter $date
-   *   DateFormatter service.
    * @param PluginManagerInterface $plugin_manager
    *   The Plugin manager service.
-   * @param DiffEntityParser $entityParser
+   * @param DiffEntityParser $entity_parser
    *   The diff field builder plugin manager.
    */
-  public function __construct(DiffFormatter $diff_formatter, DateFormatter $date, PluginManagerInterface $plugin_manager, DiffEntityParser $entityParser) {
+  public function __construct(ConfigFactory $config_factory, DiffFormatter $diff_formatter, PluginManagerInterface $plugin_manager, DiffEntityParser $entity_parser) {
+    $this->configFactory = $config_factory;
+    $this->pluginsConfig = $this->configFactory->get('diff.plugins');
     $this->diffFormatter = $diff_formatter;
-    $this->date = $date;
     $this->fieldTypeDefinitions = $plugin_manager->getDefinitions();
-    $this->config = $this->config('diff.settings');
-    $this->pluginsConfig = $this->config('diff.plugins');
-    $this->nonBreakingSpace = new FormattableMarkup('&nbsp;', array());
-    $this->entityParser = $entityParser;
-  }
-
-  /**
-   * {@inheritdoc}
-   */
-  public static function create(ContainerInterface $container) {
-    return new static(
-      $container->get('diff.diff.formatter'),
-      $container->get('date.formatter'),
-      $container->get('plugin.manager.field.field_type'),
-      $container->get('diff.entity_parser')
-    );
+    $this->entityParser = $entity_parser;
   }
 
   /**
    * This method should return an array of items ready to be compared.
    *
    * @param ContentEntityInterface $left_entity
-   *   The left entity
+   *   The left entity.
    * @param ContentEntityInterface $right_entity
-   *   The right entity
+   *   The right entity.
    *
    * @return array
    *   Items ready to be compared by the Diff component.
@@ -229,7 +201,7 @@ class EntityComparisonBase extends ControllerBase {
    * @return array
    *   Array of rows usable with theme('table').
    */
-  protected function getRows($a, $b, $show_header = FALSE, &$line_stats = NULL) {
+  public function getRows($a, $b, $show_header = FALSE, &$line_stats = NULL) {
     $a = is_array($a) ? $a : explode("\n", $a);
     $b = is_array($b) ? $b : explode("\n", $b);
 
@@ -259,7 +231,7 @@ class EntityComparisonBase extends ControllerBase {
    * @param $diff
    *   Array of strings.
    */
-  function processStateLine(&$diff) {
+  protected function processStateLine(&$diff) {
     foreach ($diff['#states'] as $state => $data) {
       if (isset($data['#left'])) {
         if (is_string($data['#left'])) {
