diff -u b/entity_clone.module b/entity_clone.module
--- b/entity_clone.module
+++ b/entity_clone.module
@@ -32,38 +32,44 @@
  * Implements hook_entity_type_build().
  */
 function entity_clone_entity_type_build(array &$entity_types) {
+  $root_namespace = '\Drupal\entity_clone\EntityClone';
+  $content_namespace = $root_namespace . '\Content';
+  $config_namespace = $root_namespace . '\Config';
+  $content_form_class_path = $content_namespace . '\ContentEntityCloneFormBase';
+  $config_form_class_path = $config_namespace . '\ConfigEntityCloneFormBase';
+
   $specific_handler = [
     'file' => [
-      'entity_clone' => '\Drupal\entity_clone\EntityClone\Content\FileEntityClone',
-      'entity_clone_form' => '\Drupal\entity_clone\EntityClone\Content\ContentEntityCloneFormBase',
+      'entity_clone' => $content_namespace . '\FileEntityClone',
+      'entity_clone_form' => $content_form_class_path,
     ],
     'user' => [
-      'entity_clone' => '\Drupal\entity_clone\EntityClone\Content\UserEntityClone',
-      'entity_clone_form' => '\Drupal\entity_clone\EntityClone\Content\ContentEntityCloneFormBase',
+      'entity_clone' => $content_namespace . '\UserEntityClone',
+      'entity_clone_form' => $content_form_class_path,
+    ],
+    'taxonomy_term' => [
+      'entity_clone' => $content_namespace . '\TaxonomyTermEntityClone',
+      'entity_clone_form' => $content_form_class_path,
     ],
     'field_config' => [
-      'entity_clone' => '\Drupal\entity_clone\EntityClone\Config\FieldConfigEntityClone',
-      'entity_clone_form' => '\Drupal\entity_clone\EntityClone\Config\ConfigEntityCloneFormBase',
+      'entity_clone' => $config_namespace . '\FieldConfigEntityClone',
+      'entity_clone_form' => $config_form_class_path,
     ],
     'node_type' => [
-      'entity_clone' => '\Drupal\entity_clone\EntityClone\Config\ConfigWithFieldEntityClone',
-      'entity_clone_form' => '\Drupal\entity_clone\EntityClone\Config\ConfigEntityCloneFormBase',
+      'entity_clone' => $config_namespace . '\ConfigWithFieldEntityClone',
+      'entity_clone_form' => $config_form_class_path,
     ],
     'comment_type' => [
-      'entity_clone' => '\Drupal\entity_clone\EntityClone\Config\ConfigWithFieldEntityClone',
-      'entity_clone_form' => '\Drupal\entity_clone\EntityClone\Config\ConfigEntityCloneFormBase',
+      'entity_clone' => $config_namespace . '\ConfigWithFieldEntityClone',
+      'entity_clone_form' => $config_form_class_path,
     ],
     'block_content_type' => [
-      'entity_clone' => '\Drupal\entity_clone\EntityClone\Config\ConfigWithFieldEntityClone',
-      'entity_clone_form' => '\Drupal\entity_clone\EntityClone\Config\ConfigEntityCloneFormBase',
+      'entity_clone' => $config_namespace . '\ConfigWithFieldEntityClone',
+      'entity_clone_form' => $config_form_class_path,
     ],
     'contact_form' => [
-      'entity_clone' => '\Drupal\entity_clone\EntityClone\Config\ConfigWithFieldEntityClone',
-      'entity_clone_form' => '\Drupal\entity_clone\EntityClone\Config\ConfigEntityCloneFormBase',
-    ],
-    'taxonomy_term' => [
-      'entity_clone' => '\Drupal\entity_clone\EntityClone\Content\TaxonomyTermEntityClone',
-      'entity_clone_form' => '\Drupal\entity_clone\EntityClone\Content\ContentEntityCloneFormBase',
+      'entity_clone' => $config_namespace . '\ConfigWithFieldEntityClone',
+      'entity_clone_form' => $config_form_class_path,
     ],
   ];
 
@@ -76,12 +82,12 @@
       }
     }
     elseif (!$entity_type->getHandlerClass('entity_clone') && $entity_type instanceof ContentEntityTypeInterface) {
-      $entity_type->setHandlerClass('entity_clone', '\Drupal\entity_clone\EntityClone\Content\ContentEntityCloneBase');
-      $entity_type->setHandlerClass('entity_clone_form', '\Drupal\entity_clone\EntityClone\Content\ContentEntityCloneFormBase');
+      $entity_type->setHandlerClass('entity_clone', $content_form_class_path);
+      $entity_type->setHandlerClass('entity_clone_form', $content_form_class_path);
     }
     elseif (!$entity_type->getHandlerClass('entity_clone') && $entity_type instanceof ConfigEntityTypeInterface) {
-      $entity_type->setHandlerClass('entity_clone', '\Drupal\entity_clone\EntityClone\Config\ConfigEntityCloneBase');
-      $entity_type->setHandlerClass('entity_clone_form', '\Drupal\entity_clone\EntityClone\Config\ConfigEntityCloneFormBase');
+      $entity_type->setHandlerClass('entity_clone', $config_form_class_path);
+      $entity_type->setHandlerClass('entity_clone_form', $config_form_class_path);
     }
   }
 }
diff -u b/src/EntityClone/Content/ContentEntityCloneBase.php b/src/EntityClone/Content/ContentEntityCloneBase.php
--- b/src/EntityClone/Content/ContentEntityCloneBase.php
+++ b/src/EntityClone/Content/ContentEntityCloneBase.php
@@ -8,6 +8,7 @@
 use Drupal\Core\Entity\EntityTypeManagerInterface;
 use Drupal\Core\Entity\FieldableEntityInterface;
 use Drupal\Core\Field\FieldConfigInterface;
+use Drupal\Core\Field\FieldItemListInterface;
 use Drupal\entity_clone\EntityClone\EntityCloneInterface;
 use Symfony\Component\DependencyInjection\ContainerInterface;
 
@@ -62,53 +63,98 @@
         if ($field_definition instanceof FieldConfigInterface && in_array($field_definition->getType(), [
-            'entity_reference',
-            'entity_reference_revisions'
-          ])) {
+          'entity_reference',
+          'entity_reference_revisions',
+        ])) {
           $field = $entity->get($field_id);
           /** @var \Drupal\Core\Field\Plugin\Field\FieldType\EntityReferenceItem $value */
           if ($field->count() > 0) {
-            $new_value = [];
-            foreach($field as $value) {
-              /** @var \Drupal\Core\Entity\ContentEntityInterface $referenced_entity */
-              $referenced_entity = $value->get('entity')->getTarget()->getValue();
-              if (isset($properties['recursive'][$field_definition->id()]['references'][$referenced_entity->id()]['clone'])
-                && $properties['recursive'][$field_definition->id()]['references'][$referenced_entity->id()]['clone'] === 1) {
-                $cloned_reference = $referenced_entity->createDuplicate();
-                /** @var \Drupal\entity_clone\EntityClone\EntityCloneInterface $entity_clone_handler */
-                $entity_clone_handler = $this->entityTypeManager->getHandler($referenced_entity->getEntityTypeId(), 'entity_clone');
-
-                $children_properties = [];
-                if (isset($properties['recursive'][$field_definition->id()]['references'][$referenced_entity->id()]['children'])) {
-                  $children_properties = $properties['recursive'][$field_definition->id()]['references'][$referenced_entity->id()]['children'];
-                }
-                $entity_clone_handler->cloneEntity($referenced_entity, $cloned_reference, $children_properties);
-
-                $new_value[] = [
-                  'target_id' => $cloned_reference->id(),
-                  'target_revision_id' => $cloned_reference->getRevisionId(),
-                ];
-              }
-              else {
-                $new_value[] = [
-                  'target_id' => $referenced_entity->id(),
-                  'target_revision_id' => $referenced_entity->getRevisionId(),
-                ];
-              }
-            }
-            $cloned_entity->set($field_id, $new_value);
+            $cloned_entity->set($field_id, $this->getNewValues($field, $field_definition, $properties));
           }
         }
       }
     }
 
-    if ($label_key = $this->entityTypeManager->getDefinition($this->entityTypeId)
-      ->getKey('label')
-    ) {
+    if ($label_key = $this->entityTypeManager->getDefinition($this->entityTypeId)->getKey('label')) {
       $cloned_entity->set($label_key, $entity->label() . ' - Cloned');
     }
 
     $cloned_entity->save();
-
     return $cloned_entity;
   }
 
+  /**
+   * Fetches new values for the clone operation.
+   *
+   * @param \Drupal\Core\Field\FieldItemListInterface $field
+   *   The field.
+   * @param Drupal\Core\Field\FieldConfigInterface $field_definition
+   *   The field definition.
+   * @param array $properties
+   *   All new properties to replace old.
+   *
+   * @return array
+   *   The list of new values.
+   */
+  protected function getNewValues(FieldItemListInterface $field, FieldConfigInterface $field_definition, array $properties) {
+    $new_values = [];
+
+    foreach ($field as $value) {
+      /** @var \Drupal\Core\Entity\ContentEntityInterface $referenced_entity */
+      $referenced_entity = $value->get('entity')->getTarget()->getValue();
+      if (isset($properties['recursive'][$field_definition->id()]['references'][$referenced_entity->id()]['clone'])
+        && $properties['recursive'][$field_definition->id()]['references'][$referenced_entity->id()]['clone'] === 1) {
+
+        $cloned_reference = $referenced_entity->createDuplicate();
+        /** @var \Drupal\entity_clone\EntityClone\EntityCloneInterface $entity_clone_handler */
+        $entity_clone_handler = $this->entityTypeManager->getHandler($referenced_entity->getEntityTypeId(), 'entity_clone');
+        $child_properties = $this->getChildProperties($field_definition, $properties, $referenced_entity);
+        $entity_clone_handler->cloneEntity($referenced_entity, $cloned_reference, $child_properties);
+        $new_values[] = $this->getTargetIds($cloned_reference->id(), $cloned_reference->getRevisionId());
+      }
+      else {
+        $new_values[] = $this->getTargetIds($referenced_entity->id(), $referenced_entity->getRevisionId());
+      }
+    }
+
+    return $new_values;
+  }
+
+  /**
+   * Fetches the child properties.
+   *
+   * @param Drupal\Core\Field\FieldConfigInterface $field_definition
+   *   The field definition.
+   * @param array $properties
+   *   All new properties to replace old.
+   * @param \Drupal\Core\Entity\EntityInterface $referenced_entity
+   *   The entity.
+   *
+   * @return array
+   *   The child properties.
+   */
+  protected function getChildProperties(FieldConfigInterface $field_definition, array $properties, EntityInterface $referenced_entity) {
+    $child_properties = [];
+    if (isset($properties['recursive'][$field_definition->id()]['references'][$referenced_entity->id()]['children'])) {
+      $child_properties = $properties['recursive'][$field_definition->id()]['references'][$referenced_entity->id()]['children'];
+    }
+    return $child_properties;
+  }
+
+  /**
+   * Fetches the list of target IDs.
+   *
+   * @param int $target_id
+   *   The target ID.
+   * @param int $target_revision_id
+   *   The target revision ID.
+   *
+   * @return array
+   *   The list of target IDs.
+   */
+  protected function getTargetIds($target_id, $target_revision_id) {
+    return [
+      'target_id' => $target_id,
+      'target_revision_id' => $target_revision_id,
+    ];
+  }
+
 }
diff -u b/src/EntityClone/Content/ContentEntityCloneFormBase.php b/src/EntityClone/Content/ContentEntityCloneFormBase.php
--- b/src/EntityClone/Content/ContentEntityCloneFormBase.php
+++ b/src/EntityClone/Content/ContentEntityCloneFormBase.php
@@ -51,6 +51,8 @@
    *   The entity type manager.
    * @param \Drupal\Core\StringTranslation\TranslationManager $translation_manager
    *   The string translation manager.
+   * @param \Drupal\entity_clone\EntityCloneSettingsManager $entity_clone_settings_manager
+   *   The entity clone settings manager.
    */
   public function __construct(EntityTypeManager $entity_type_manager, TranslationManager $translation_manager, EntityCloneSettingsManager $entity_clone_settings_manager) {
     $this->entityTypeManager = $entity_type_manager;
@@ -93,7 +95,7 @@
               '#access' => !$this->entityCloneSettingsManager->getHiddenValue($field_definition->getFieldStorageDefinition()->getSetting('target_type')),
             ];
 
-            foreach($field as $value) {
+            foreach ($field as $value) {
               /** @var \Drupal\Core\Entity\ContentEntityInterface $referenced_entity */
               $referenced_entity = $value->get('entity')->getTarget()->getValue();
 
@@ -141,11 +143,11 @@
    *   The list of children.
    */
   protected function getChildren(ContentEntityInterface $referenced_entity) {
-      /** @var \Drupal\entity_clone\EntityClone\EntityCloneFormInterface $entity_clone_handler */
-      if ($this->entityTypeManager->hasHandler($referenced_entity->getEntityTypeId(), 'entity_clone_form')) {
-        $entity_clone_form_handler = $this->entityTypeManager->getHandler($referenced_entity->getEntityTypeId(), 'entity_clone_form');
-        return $entity_clone_form_handler->formElement($referenced_entity);
-      }
+    /** @var \Drupal\entity_clone\EntityClone\EntityCloneFormInterface $entity_clone_handler */
+    if ($this->entityTypeManager->hasHandler($referenced_entity->getEntityTypeId(), 'entity_clone_form')) {
+      $entity_clone_form_handler = $this->entityTypeManager->getHandler($referenced_entity->getEntityTypeId(), 'entity_clone_form');
+      return $entity_clone_form_handler->formElement($referenced_entity);
+    }
   }
 
   /**
diff -u b/src/EntityCloneSettingsManager.php b/src/EntityCloneSettingsManager.php
--- b/src/EntityCloneSettingsManager.php
+++ b/src/EntityCloneSettingsManager.php
@@ -61,8 +61,9 @@
    * Get all content entity types.
    *
    * @return \Drupal\Core\Entity\ContentEntityTypeInterface[]
+   *   The content entity types.
    */
-  public function getContentEntityTypes($allowed_only = FALSE) {
+  public function getContentEntityTypes() {
     $definitions = $this->entityTypeManager->getDefinitions();
     $ret = [];
     foreach ($definitions as $machine => $type) {
@@ -78,10 +79,11 @@
    * Set the entity clone settings.
    *
    * @param array $settings
+   *   The settings.
    */
   public function setFormSettings(array $settings) {
     if (isset($settings['table'])) {
-      array_walk_recursive($settings['table'], function (&$item){
+      array_walk_recursive($settings['table'], function (&$item) {
         if ($item == '1') {
           $item = TRUE;
         }
@@ -94,11 +96,13 @@
   }
 
   /**
-   * Get the checkbox default value for a given entity type
+   * Get the checkbox default value for a given entity type.
    *
-   * @param $entity_type_id
+   * @param int $entity_type_id
+   *   The entity type ID.
    *
-   * @return bool
+   * @return mixed|false
+   *   The default value or FALSE if there isn't one.
    */
   public function getDefaultValue($entity_type_id) {
     $form_settings = $this->config->get('form_settings');
@@ -109,11 +113,13 @@
   }
 
   /**
-   * Get the checkbox disable value for a given entity type
+   * Get the checkbox disable value for a given entity type.
    *
-   * @param $entity_type_id
+   * @param int $entity_type_id
+   *   The entity type ID.
    *
-   * @return bool
+   * @return mixed|false
+   *   The disable value or FALSE if there isn't one.
    */
   public function getDisableValue($entity_type_id) {
     $form_settings = $this->config->get('form_settings');
@@ -124,11 +130,13 @@
   }
 
   /**
-   * Get the checkbox hidden value for a given entity type
+   * Get the checkbox hidden value for a given entity type.
    *
-   * @param $entity_type_id
+   * @param int $entity_type_id
+   *   The entity type ID.
    *
    * @return bool
+   *   The hidden value or FALSE if there isn't one.
    */
   public function getHiddenValue($entity_type_id) {
     $form_settings = $this->config->get('form_settings');
diff -u b/src/Form/EntityCloneSettingsForm.php b/src/Form/EntityCloneSettingsForm.php
--- b/src/Form/EntityCloneSettingsForm.php
+++ b/src/Form/EntityCloneSettingsForm.php
@@ -15,6 +15,8 @@
 class EntityCloneSettingsForm extends ConfigFormBase implements ContainerInjectionInterface {
 
   /**
+   * The settings manager.
+   *
    * @var \Drupal\entity_clone\EntityCloneSettingsManager
    */
   protected $entityCloneSettingsManager;
diff -u b/src/Tests/EntityCloneContentRecursiveTest.php b/src/Tests/EntityCloneContentRecursiveTest.php
--- b/src/Tests/EntityCloneContentRecursiveTest.php
+++ b/src/Tests/EntityCloneContentRecursiveTest.php
@@ -104 +104 @@
-}
\ No newline at end of file
+}
only in patch2:
unchanged:
--- a/entity_clone.info.yml
+++ b/entity_clone.info.yml
@@ -2,3 +2,4 @@ name: Entity Clone
 description: Add a clone action for all entities
 core:  "8.x"
 type: module
+configure: entity_clone.settings
only in patch2:
unchanged:
--- a/src/EntityClone/EntityCloneInterface.php
+++ b/src/EntityClone/EntityCloneInterface.php
@@ -19,9 +19,9 @@ interface EntityCloneInterface {
    * @param array $properties
    *   All new properties to replace old.
    *
-   * @return \Drupal\Core\Entity\EntityInterface The new saved entity.
-   * The new saved entity.
+   * @return \Drupal\Core\Entity\EntityInterface
+   *   The new saved entity.
    */
-  public function cloneEntity(EntityInterface $entity, EntityInterface $cloned_entity, $properties = []);
+  public function cloneEntity(EntityInterface $entity, EntityInterface $cloned_entity, array $properties = []);
 
 }
