diff --git a/README.md b/README.md
index dbc25e80c207eb3f81f394b51d75a3653b1697eb..16d3d2ab662e6364bfd5201e847d7a471c7f78f6 100644
--- a/README.md
+++ b/README.md
@@ -1,14 +1,18 @@
-# Entity Type Clone
+# Entity Type Clone (Role clone included)
 
 Entity Type Clone allows Administrator to clone Content types, 
-Paragraphs, and Vocabularies. These will be used in creating an additional 
+Paragraphs, Profiles, Storage and Vocabularies. 
+These will be used in creating an additional 
 entity type with the existing one. You can clone entity type along with 
 the Form and View modes.
 
 Entities that are fully supported:
 
+- Block Type (Custom Block types)
 - Content
 - Paragraph
+- Profile
+- Storage
 - Taxonomy
 
 For a full description of the module, visit the
@@ -20,7 +24,7 @@ Submit bug reports and feature suggestions, or track changes in the
 
 ## Requirements
 
-This module requires no modules outside of Drupal core.
+This module requires no modules outside of Drupal core as a dependency.
 
 
 ## Installation
@@ -32,10 +36,10 @@ information, see
 
 ## Configuration
 
-For configuration settings go to `admin/entity-type-clone`.
+For configuration settings go to `admin/config/entity-type-clone`.
 
 
 ## Maintainers
 
-- A Ajay Kumar Reddy - [ajay_reddy](https://www.drupal.org/u/ajay_reddy)
+- Ajay Reddy - [ajay_reddy](https://www.drupal.org/u/ajay_reddy)
 - Ilcho Vuchkov - [vuil](https://www.drupal.org/u/vuil)
diff --git a/entity_type_clone.info.yml b/entity_type_clone.info.yml
index eed08407c58fd8b17b628fabf5a7040d2db5189b..d6a6843ef9b21c539c9651604e3839177c523116 100644
--- a/entity_type_clone.info.yml
+++ b/entity_type_clone.info.yml
@@ -1,7 +1,10 @@
 name: Entity Type Clone
 type: module
-description: This module provide option to clone entity types.
-core: 8.x
-core_version_requirement: ^8 || ^9
+description: This module provide option to clone entity types and role.
+core_version_requirement: ^8 || ^9 || ^10
 package: Other
 configure: entity_type_clone.type
+dependencies:
+  - drupal:block_content
+  - drupal:node
+  - drupal:taxonomy
diff --git a/entity_type_clone.links.action.yml b/entity_type_clone.links.action.yml
new file mode 100644
index 0000000000000000000000000000000000000000..6ea4f51223dc5c4d0c764bda90c1d2c728988c0b
--- /dev/null
+++ b/entity_type_clone.links.action.yml
@@ -0,0 +1,11 @@
+entity_type_clone.type:
+  route_name: entity_type_clone.type
+  title: 'Entity type clone'
+  appears_on:
+    - entity_type_clone.role
+
+entity_type_clone.role:
+  route_name: entity_type_clone.role
+  title: 'Clone role'
+  appears_on:
+    - entity_type_clone.type
diff --git a/entity_type_clone.links.menu.yml b/entity_type_clone.links.menu.yml
index 831163e43ebfda227c1c8987de86d70f9994a9d3..7de7a6ca0bc824cad593cfa491e62b1fe9e44476 100644
--- a/entity_type_clone.links.menu.yml
+++ b/entity_type_clone.links.menu.yml
@@ -1,8 +1,6 @@
-# Entity Type Clone menu items definition
 entity_type_clone.entity_type_clone:
   title: 'Entity Type Clone'
   route_name: entity_type_clone.type
   description: 'Entity Type Clone'
   parent: system.admin_config
   weight: 99
-
diff --git a/entity_type_clone.module b/entity_type_clone.module
index 7feb051b41827b173738de0a5e6fc5dd2bf16d32..80e889efe9098f8c1739a22f5ac0d1a1b195f4aa 100644
--- a/entity_type_clone.module
+++ b/entity_type_clone.module
@@ -4,11 +4,12 @@
  * @file
  * Allows to clone entity types from a simple link.
  */
-use Drupal\Core\Url;
+
 use Drupal\Core\Entity\EntityInterface;
 use Drupal\Core\Routing\RouteMatchInterface;
+use Drupal\Core\Url;
 
- /**
+/**
  * Implements hook_help().
  */
 function entity_type_clone_help($route_name, RouteMatchInterface $route_match) {
@@ -19,7 +20,12 @@ function entity_type_clone_help($route_name, RouteMatchInterface $route_match) {
       $output .= '<h3>' . t('About') . '</h3>';
       $output .= '<p>' . t('Entity Type Clone allows Administrator to clone Content types, Paragraphs, and Vocabularies.
       These will be used in creating an additional entity type with the existing one.
-      You can clone entity type along with the Form and View modes.') . '</p>';
+      You can clone entity type along with the Form and View modes. For more information, see the <a href=":project_link">online documentation for the Automated Cron module</a>.', [':project_link' => 'https://www.drupal.org/project/entity_type_clone']) . '</p>';
+      $output .= '<h3>' . t('Uses') . '</h3>';
+      $output .= '<dl>';
+      $output .= '<dt>' . t('Clone Entity Type') . '</dt>';
+      $output .= '<dd>' . t('On the <a href=":entity_type_settings-settings">Clone Entity Type page</a>, you can clone an entity type here.', [':entity_type_settings-settings' => Url::fromRoute('entity_type_clone.type')->toString()]) . '</dd>';
+      $output .= '</dl>';
       return $output;
   }
 }
@@ -34,21 +40,23 @@ function entity_type_clone_help($route_name, RouteMatchInterface $route_match) {
  *   The entity on which the linked operations will be performed.
  */
 function entity_type_clone_entity_operation_alter(array &$operations, EntityInterface $entity) {
-//Get the entity info.
+  // Get the entity info.
   $info = $entity->getEntityType();
-//Get the entity bundle.
+  // Get the entity bundle.
   $bundle_of = $info->getBundleOf();
-//Get the user account.
+  // Get the user account.
   $account = \Drupal::currentUser();
-//Add the clone link to operations.
+  // Add the clone link to operations.
   $clone_types = ['node', 'paragraph', 'taxonomy_term', 'profile'];
   if ($account->hasPermission('access entity type clone') && (in_array($bundle_of, $clone_types))) {
     $operations['clone'] = [
       'title' => t('Clone @label', ['@label' => $entity->label()]),
       'weight' => 30,
       'url' => Url::fromRoute(
-        "entity_type_clone.type", ['entity' => $bundle_of, 'bundle' => $entity->id(),
-      ]),
+        "entity_type_clone.type", [
+          'entity' => $bundle_of,
+          'bundle' => $entity->id(),
+        ]),
     ];
   }
 }
diff --git a/entity_type_clone.routing.yml b/entity_type_clone.routing.yml
index 04ccafba3e85b335db1b3a07cb1ec51eeee73a7c..bb6e62afef1b3b96b504f1871d35964a1db4af40 100644
--- a/entity_type_clone.routing.yml
+++ b/entity_type_clone.routing.yml
@@ -1,7 +1,15 @@
 entity_type_clone.type:
-  path: '/admin/entity-type-clone'
+  path: '/admin/config/entity-type-clone'
   defaults:
-    _form: '\Drupal\entity_type_clone\Form\CloneEntityType'
+    _form: '\Drupal\entity_type_clone\Form\CloneEntityTypeForm'
     _title: 'Clone Entity type'
   requirements:
     _permission: 'access entity type clone'
+
+entity_type_clone.role:
+  path: '/admin/config/role-clone'
+  defaults:
+    _form: '\Drupal\entity_type_clone\Form\CloneRole'
+    _title: 'Clone Role'
+  requirements:
+    _permission: 'access entity type clone'
diff --git a/src/Form/CloneEntityTypeData.php b/src/CloneEntityType.php
similarity index 57%
rename from src/Form/CloneEntityTypeData.php
rename to src/CloneEntityType.php
index 1536f605c9d595b787a53905ec92bf8ccc3f3f46..29e566c6460b5ed3425b252ebc714f9d1107a1da 100644
--- a/src/Form/CloneEntityTypeData.php
+++ b/src/CloneEntityType.php
@@ -1,21 +1,23 @@
 <?php
 
-namespace Drupal\entity_type_clone\Form;
+namespace Drupal\entity_type_clone;
 
+use Drupal\block_content\Entity\BlockContentType;
 use Drupal\Core\Entity\EntityInterface;
 use Drupal\entity_type_clone\Controller\EntityTypeCloneController;
 use Drupal\node\Entity\NodeType;
 use Drupal\paragraphs\Entity\ParagraphsType;
 use Drupal\profile\Entity\ProfileType;
+use Drupal\storage\Entity\StorageType;
 use Drupal\taxonomy\Entity\Vocabulary;
 use Symfony\Component\HttpFoundation\RedirectResponse;
 
 /**
- * Class CloneEntityTypeData.
+ * Class for cloning entity type data form.
  *
  * @package Drupal\entity_type_clone\Form
  */
-class CloneEntityTypeData {
+class CloneEntityType {
 
   /**
    * Clones a entity type field.
@@ -32,32 +34,34 @@ class CloneEntityTypeData {
     // Only create a duplicate of an entity if the field implements,
     // EntityInterface (as this is not guaranteed e.g. for Content moderation).
     if ($data['field'] instanceof EntityInterface) {
-      // Only create a duplicate of an entity if the field implements,
-      // EntityInterface (as this is not guaranteed e.g. for Content moderation).
-      // Clone the field.
       $targetFieldConfig = $data['field']->createDuplicate();
       $targetFieldConfig->set('entity_type', $data['values']['show']['entity_type']);
       $targetFieldConfig->set('bundle', $data['values']['clone_bundle_machine']);
       $targetFieldConfig->save();
     }
     // Copy the form display.
-    $form_mode_displays = \Drupal::service('entity_display.repository')->getFormModeOptionsByBundle($data['values']['show']['entity_type'], $data['values']['show']['type']);
-    foreach ($form_mode_displays as $form_mode_display => $value) {
-      EntityTypeCloneController::copyFieldDisplay('form', $form_mode_display, $data);
+    $form_mode_displays = \Drupal::service('entity_display.repository')
+      ->getFormModeOptionsByBundle($data['values']['show']['entity_type'], $data['values']['show']['type']);
+    if ($form_mode_displays) {
+      foreach ($form_mode_displays as $form_mode_display => $value) {
+        EntityTypeCloneController::copyFieldDisplay('form', $form_mode_display, $data);
+      }
     }
     $config_factory = \Drupal::configFactory();
     $modes = $config_factory->listAll('core.entity_view_display' . '.' . $data['values']['show']['entity_type'] . '.' . $data['values']['show']['type']);
-    foreach ($modes as $mode) {
-      $mode_explode = explode('.', $mode);
-      $view_mode = $mode_explode[4];
-      // Copy the view display.
-      EntityTypeCloneController::copyFieldDisplay('view', $view_mode, $data);
+    if ($modes) {
+      foreach ($modes as $mode) {
+        $mode_explode = explode('.', $mode);
+        $view_mode = $mode_explode[4];
+        // Copy the view display.
+        EntityTypeCloneController::copyFieldDisplay('view', $view_mode, $data);
+      }
     }
     // Update the progress information.target_machine_name.
     if (empty($context['sandbox']['progress'])) {
       $context['sandbox']['progress'] = 0;
     }
-    $context['sandbox']['progress']++;
+    $context['sandbox']['progress'];
     $context['sandbox']['current_item'] = $sourceFieldName;
     $context['message'] = t(
       'Field @source successfully cloned.', ['@source' => $sourceFieldName]
@@ -93,42 +97,68 @@ class CloneEntityTypeData {
       }
     }
     if ($values['show']['entity_type'] === 'paragraph') {
-      $sourceContentType = ParagraphsType::load($values['show']['type']);
-      if (isset($sourceContentType)) {
+      $sourceParagraphType = ParagraphsType::load($values['show']['type']);
+      if (isset($sourceParagraphType)) {
         // Create the target entity type.
-        $targetContentType = $sourceContentType->createDuplicate();
-        $targetContentType->set('uuid', \Drupal::service('uuid')->generate());
-        $targetContentType->set('label', $values['clone_bundle']);
-        $targetContentType->set('id', $values['clone_bundle_machine']);
-        $targetContentType->set('originalId', $values['clone_bundle_machine']);
-        $targetContentType->set('description', $values['target_description']);
-        $targetContentType->save();
+        $targetParagraphType = $sourceParagraphType->createDuplicate();
+        $targetParagraphType->set('uuid', \Drupal::service('uuid')->generate());
+        $targetParagraphType->set('label', $values['clone_bundle']);
+        $targetParagraphType->set('id', $values['clone_bundle_machine']);
+        $targetParagraphType->set('originalId', $values['clone_bundle_machine']);
+        $targetParagraphType->set('description', $values['target_description']);
+        $targetParagraphType->save();
       }
     }
     if ($values['show']['entity_type'] === 'taxonomy_term') {
-      $vocabulary = Vocabulary::create(array(
-          'vid' => $values['clone_bundle_machine'],
-          'description' => $values['target_description'],
-          'name' => $values['clone_bundle'],
-      ));
+      $vocabulary = Vocabulary::create([
+        'vid' => $values['clone_bundle_machine'],
+        'description' => $values['target_description'],
+        'name' => $values['clone_bundle'],
+      ]);
+      $vocabulary->set('uuid', \Drupal::service('uuid')->generate());
       $vocabulary->save();
     }
+    // Clone block content.
+    if ($values['show']['entity_type'] === 'block_content') {
+      $sourceParagraphType = BlockContentType::load($values['show']['type']);
+      if (isset($sourceParagraphType)) {
+        // Create the target entity type.
+        $targetBlockType = $sourceParagraphType->createDuplicate();
+        $targetBlockType->set('uuid', \Drupal::service('uuid')->generate());
+        $targetBlockType->set('label', $values['clone_bundle']);
+        $targetBlockType->set('id', $values['clone_bundle_machine']);
+        $targetBlockType->set('originalId', $values['clone_bundle_machine']);
+        $targetBlockType->set('description', $values['target_description']);
+        $targetBlockType->save();
+      }
+    }
     if ($values['show']['entity_type'] === 'profile') {
       $profile_type_load = ProfileType::load($values['show']['type']);
       if (isset($profile_type_load)) {
         $type = ProfileType::create([
-            'id' => $values['clone_bundle_machine'],
-            'label' => $values['clone_bundle'],
-            'description' => isset($values['target_description']) ? $values['target_description'] : $profile_type_load->getDescription(),
-            'registration' => $profile_type_load->getRegistration(),
-            'multiple' => $profile_type_load->getMultiple(),
-            'roles' => $profile_type_load->getRoles(),
+          'id' => $values['clone_bundle_machine'],
+          'label' => $values['clone_bundle'],
+          'description' => $values['target_description'] ?? $profile_type_load->getDescription(),
+          'registration' => $profile_type_load->getRegistration(),
+          'multiple' => $profile_type_load->allowsMultiple(),
+          'roles' => $profile_type_load->getRoles(),
         ]);
         $type->save();
       }
     }
+    if ($values['show']['entity_type'] === 'storage') {
+      $storage_type_load = StorageType::load($values['show']['type']);
+      if (isset($storage_type_load)) {
+        $storageTypeSave = StorageType::create([
+          'id' => $values['clone_bundle_machine'],
+          'label' => $values['clone_bundle'],
+          'description' => $values['target_description'] ?? $storage_type_load->getDescription(),
+        ]);
+        $storageTypeSave->save();
+      }
+    }
     // Update the progress information.
-    $context['sandbox']['progress']++;
+    $context['sandbox']['progress'];
     $context['sandbox']['current_item'] = $values['show']['type'];
     $context['message'] = t(
       'Entity type @source successfully cloned.', ['@source' => $values['show']['type']]
@@ -150,9 +180,9 @@ class CloneEntityTypeData {
   public static function cloneEntityTypeFinishedCallback($success, array $results, array $operations) {
     // Check batch operations success.
     if ($success) {
-      $message = t('"@source" content type and @fields field(s) cloned successfuly to "@target".', [
+      $message = t('"@source" type and @fields field(s) cloned successfuly to "@target".', [
         '@source' => $results['source'][0],
-        '@fields' => count($results['fields']),
+        '@fields' => isset($results['fields']) ? count($results['fields']) : 0,
         '@target' => $results['target'][0],
       ]);
     }
@@ -162,7 +192,7 @@ class CloneEntityTypeData {
     // Send the result message.
     \Drupal::messenger()->addStatus($message);
     // Redirect to the entity type clone page.
-    $response = new RedirectResponse('admin/entity-type-clone');
+    $response = new RedirectResponse('admin/config/entity-type-clone');
     $response->send();
   }
 
diff --git a/src/Controller/EntityTypeCloneController.php b/src/Controller/EntityTypeCloneController.php
index 0a0782b14d2eb3ffc4739fcc592d72a94f644b45..b6338efcd6abc7937682073354610bd92b3822dd 100644
--- a/src/Controller/EntityTypeCloneController.php
+++ b/src/Controller/EntityTypeCloneController.php
@@ -6,7 +6,7 @@ use Drupal\Core\Controller\ControllerBase;
 use Symfony\Component\HttpFoundation\JsonResponse;
 
 /**
- * Class EntityTypeCloneController.
+ * Controller for EntityTypeClone operations.
  *
  * @package Drupal\entity_type_clone\Controller
  */
@@ -14,52 +14,56 @@ class EntityTypeCloneController extends ControllerBase {
 
   /**
    * Replaces string values recursively in an array.
-   *
-   * @param string $find
-   *   The string to find in the array values.
-   * @param string $replace
-   *   The replacement string.
-   * @param array $arr
-   *   The array to search.
-   * @return array
-   *   The array with values replaced.
    */
-  public static function arrayReplace($find, $replace, $arr) {
+  public static function arrayReplace(string $find, string $replace, array $arr): array {
     $newArray = [];
     foreach ($arr as $key => $value) {
+      // Validate the fields like "status" and "weight" first.
+      if (is_bool($value) || is_numeric($value)) {
+        $newArray[$key] = $value;
+      }
       if (is_array($value)) {
         $newArray[$key] = self::arrayReplace($find, $replace, $value);
       }
-      else {
+      elseif (is_string($value)) {
         $newArray[$key] = str_replace($find, $replace, $value);
       }
     }
     return $newArray;
   }
 
+  /**
+   * Implements to copy field display.
+   */
   public static function copyFieldDisplay($display, $mode, $data) {
-    // Prepare the storage string
+    // Prepare the storage string.
     $storage = 'entity_' . $display . '_display';
     // Get the source field name.
     $sourceFieldName = $data['field']->getName();
     // Get the source form display.
-    $sourceDisplay = \Drupal::entityTypeManager()->getStorage($storage)->load($data['values']['show']['entity_type'] . '.' . $data['values']['show']['type'] . '.' . $mode)->toArray();
+    $sourceDisplay = \Drupal::entityTypeManager()
+      ->getStorage($storage)
+      ->load($data['values']['show']['entity_type'] . '.' . $data['values']['show']['type'] . '.' . $mode)
+      ->toArray();
     // Prepare the target form display.
     $targetDisplay = EntityTypeCloneController::arrayReplace(
-        $data['values']['show']['type'], $data['values']['clone_bundle_machine'], $sourceDisplay
+      $data['values']['show']['type'], $data['values']['clone_bundle_machine'], $sourceDisplay
     );
-    unset($targetDisplay['uuid'], $targetDisplay['_core']);
+    unset($targetDisplay['_core']);
+    // Generate new uuid.
+    $targetDisplay['uuid'] = \Drupal::service('uuid')->generate();
     // Save the target display.
     if ($display === 'form') {
       // Save the form display.
-      $displayConfig = \Drupal::configFactory()
+      \Drupal::configFactory()
         ->getEditable('core.' . $storage . '.' . $data['values']['show']['entity_type'] . '.' . $data['values']['clone_bundle_machine'] . '.' . $mode)
         ->setData($targetDisplay)
         ->save();
     }
     elseif ($display === 'view') {
       // Save the view display.
-      $entityDisplay = \Drupal::service('entity_display.repository')->getViewDisplay($data['values']['show']['entity_type'], $data['values']['clone_bundle_machine'], $mode);
+      $entityDisplay = \Drupal::service('entity_display.repository')
+        ->getViewDisplay($data['values']['show']['entity_type'], $data['values']['clone_bundle_machine'], $mode);
       if (isset($targetDisplay['content'][$sourceFieldName])) {
         $entityDisplay->setComponent($sourceFieldName, $targetDisplay['content'][$sourceFieldName]);
       }
diff --git a/src/Controller/UUIDController.php b/src/Controller/UUIDController.php
index 3f3b9f1b855d800dc5736255ba54eff5c1cdc7c4..44d1d1bd8adeb9b6d1de3bebefc6fe2ae655b47d 100644
--- a/src/Controller/UUIDController.php
+++ b/src/Controller/UUIDController.php
@@ -4,24 +4,64 @@ namespace Drupal\entity_type_clone\Controller;
 
 use Drupal\Core\Controller\ControllerBase;
 use Drupal\Core\Entity\ContentEntityType;
+use Drupal\Core\Entity\EntityTypeManagerInterface;
+use Symfony\Component\DependencyInjection\ContainerInterface;
 
 /**
- * Class UUIDController.
+ * Controller for UUID-related functionality.
  *
  * @package Drupal\entity_type_clone\Controller
  */
 class UUIDController extends ControllerBase {
 
+  /**
+   * The entity type manager.
+   *
+   * @var \Drupal\Core\Entity\EntityTypeManagerInterface
+   */
+  protected $entityTypeManager;
+
+  /**
+   * The service container.
+   *
+   * @var \Drupal\Component\DependencyInjection\Container|\Symfony\Component\DependencyInjection\Container
+   */
+  private $serviceContainer;
+
+  /**
+   * Constructor function.
+   */
+  public function __construct(EntityTypeManagerInterface $entity_type_manager, $serviceContainer) {
+    $this->entityTypeManager = $entity_type_manager;
+    $this->serviceContainer = $serviceContainer;
+  }
+
+  /**
+   * Creates a new container for dependency injection.
+   */
+  public static function create(ContainerInterface $container) {
+    return new static(
+      $container->get('entity_type.manager')
+    );
+  }
+
+  /**
+   * Gets the UUID.
+   */
   public function uuidGet() {
     $uuid = [];
-    $entity_type_definations = \Drupal::entityTypeManager()->getDefinitions();
+    $entity_type_definations = $this->entityTypeManager->getDefinitions();
     foreach ($entity_type_definations as $definition) {
       if ($definition instanceof ContentEntityType) {
-        $content_types = \Drupal::service('entity_type.bundle.info')->getBundleInfo($definition->id());
+        $content_types = $this->serviceContainer->get('entity_type.bundle.info')
+          ->getBundleInfo($definition->id());
         $entity_type = $definition->getBundleEntityType();
         if ($entity_type && $content_types) {
           foreach ($content_types as $type_id => $type) {
-            $uuid[$entity_type][$type_id] = \Drupal::entityTypeManager()->getStorage($entity_type)->load($type_id)->uuid();
+            $uuid[$entity_type][$type_id] = $this->entityTypeManager
+              ->getStorage($entity_type)
+              ->load($type_id)
+              ->uuid();
           }
         }
       }
diff --git a/src/Form/CloneEntityType.php b/src/Form/CloneEntityTypeForm.php
similarity index 50%
rename from src/Form/CloneEntityType.php
rename to src/Form/CloneEntityTypeForm.php
index 7b1e40726c3e81d67e6d80f78475067bebd0cf08..07c8e61b13cdf9f7edcc00a89cbf55494b3a3499 100644
--- a/src/Form/CloneEntityType.php
+++ b/src/Form/CloneEntityTypeForm.php
@@ -2,18 +2,23 @@
 
 namespace Drupal\entity_type_clone\Form;
 
+use Drupal\Component\Serialization\Json;
 use Drupal\Core\Entity\ContentEntityType;
+use Drupal\Core\Entity\EntityFieldManagerInterface;
+use Drupal\Core\Entity\EntityTypeBundleInfoInterface;
 use Drupal\Core\Entity\EntityTypeManagerInterface;
+use Drupal\Core\Extension\ModuleHandlerInterface;
 use Drupal\Core\Form\FormBase;
 use Drupal\Core\Form\FormStateInterface;
 use Symfony\Component\DependencyInjection\ContainerInterface;
+use Symfony\Component\HttpFoundation\Request;
 
 /**
- * Class CloneEntityType.
+ * Class for cloning entity type form.
  *
  * @package Drupal\entity_type_clone\Form
  */
-class CloneEntityType extends FormBase {
+class CloneEntityTypeForm extends FormBase {
 
   /**
    * {@inheritdoc}
@@ -29,13 +34,55 @@ class CloneEntityType extends FormBase {
    */
   protected $entityTypeManager;
 
-  public function __construct(EntityTypeManagerInterface $entity_type_manager) {
+  /**
+   * The request object.
+   *
+   * @var \Symfony\Component\HttpFoundation\Request
+   */
+  protected $request;
+
+  /**
+   * The module handler.
+   *
+   * @var \Drupal\Core\Extension\ModuleHandlerInterface
+   */
+  protected $moduleHandler;
+
+  /**
+   * The entity type bundle info service.
+   *
+   * @var \Drupal\Core\Entity\EntityTypeBundleInfoInterface
+   */
+  protected $entityTypeBundleInfo;
+
+  /**
+   * The entity field manager.
+   *
+   * @var \Drupal\Core\Entity\EntityFieldManagerInterface
+   */
+  protected $entityFieldManager;
+
+  /**
+   * Constructor function.
+   */
+  public function __construct(EntityTypeManagerInterface $entity_type_manager, Request $request, ModuleHandlerInterface $moduleHandler, EntityTypeBundleInfoInterface $entity_type_bundle_info, EntityFieldManagerInterface $entity_field_manager) {
     $this->entityTypeManager = $entity_type_manager;
+    $this->request = $request;
+    $this->moduleHandler = $moduleHandler;
+    $this->entityTypeBundleInfo = $entity_type_bundle_info;
+    $this->entityFieldManager = $entity_field_manager;
   }
 
+  /**
+   * Creates a new container for dependency injection.
+   */
   public static function create(ContainerInterface $container) {
     return new static(
-      $container->get('entity_type.manager')
+      $container->get('entity_type.manager'),
+      $container->get('request_stack')->getCurrentRequest(),
+      $container->get('module_handler'),
+      $container->get('entity_type.bundle.info'),
+      $container->get('entity_field.manager')
     );
   }
 
@@ -43,7 +90,7 @@ class CloneEntityType extends FormBase {
    * {@inheritdoc}
    */
   public function buildForm(array $form, FormStateInterface $form_state) {
-    $params = \Drupal::request()->query;
+    $params = $this->request->query;
     $disbaled = FALSE;
     if ($params) {
       $entity_type = $params->get('entity');
@@ -65,15 +112,36 @@ class CloneEntityType extends FormBase {
     ];
     $content_entity_types = [];
     $entity_type_definations = $this->entityTypeManager->getDefinitions();
-    /* @var $definition \Drupal\Core\Entity\EntityTypeInterface */
-    $clone_types = ['node', 'paragraph', 'taxonomy_term', 'profile'];
+    /** @var \Drupal\Core\Entity\EntityTypeInterface $definition */
+    $clone_types = [
+      'block_content',
+      'node',
+      'taxonomy_term',
+    ];
+    $moduleHandler = $this->moduleHandler;
+    if ($moduleHandler->moduleExists('paragraphs')) {
+      $clone_types[] = 'paragraph';
+    }
+    if ($moduleHandler->moduleExists('profile')) {
+      $clone_types[] = 'profile';
+    }
+    if ($moduleHandler->moduleExists('storage')) {
+      $clone_types[] = 'storage';
+    }
     foreach ($entity_type_definations as $definition) {
       if ($definition instanceof ContentEntityType) {
         if (in_array($definition->id(), $clone_types)) {
           $content_entity_types[$definition->id()] = $definition->getLabel();
+          $bundleEntityTypes[$definition->id()] = $definition->getBundleEntityType();
         }
       }
     }
+    if ($bundleEntityTypes) {
+      $form['bundle_types'] = [
+        '#type' => 'hidden',
+        '#value' => Json::encode($bundleEntityTypes),
+      ];
+    }
     $form['displays']['show']['entity_type'] = [
       '#type' => 'select',
       '#title' => $this->t('Select Entity Type'),
@@ -82,34 +150,38 @@ class CloneEntityType extends FormBase {
       '#size' => 1,
       '#required' => TRUE,
       '#disabled' => $disbaled,
-      '#default_value' => isset($entity_type) ? $entity_type : '',
+      '#default_value' => $entity_type ?? '',
       '#suffix' => '<div id="' . $wrapper . '"></div>',
       '#ajax' => [
         'callback' => [$this, 'ajaxCallChangeEntity'],
         'wrapper' => $wrapper,
-      ]
+      ],
     ];
     if (isset($input['show']['entity_type']) || isset($entity_type)) {
-      $entity_type_selected = isset($input['show']['entity_type']) ? $input['show']['entity_type'] : $entity_type;
-      $default_bundles = \Drupal::service('entity_type.bundle.info')->getBundleInfo($entity_type_selected);
-      // If the current base table support bundles and has more than one (like user).
-      if (!empty($default_bundles)) {
-        // Get all bundles and their human readable names.
-        foreach ($default_bundles as $type => $bundle) {
-          $type_options[$type] = $bundle['label'];
+      $entity_type_selected = $input['show']['entity_type'] ?? $entity_type;
+      if ($entity_type_selected) {
+        $default_bundles = $this->entityTypeBundleInfo->getBundleInfo($entity_type_selected);
+        // If the current base table support bundles and
+        // has more than one (like user).
+        if (!empty($default_bundles)) {
+          // Get all bundles and their human-readable names.
+          foreach ($default_bundles as $type => $bundle) {
+            $type_options[$type] = $bundle['label'];
+          }
+          $form['displays']['show']['type']['#options'] = $type_options;
         }
-        $form['displays']['show']['type']['#options'] = $type_options;
       }
     }
     if (isset($type_options)) {
       $form['displays']['show']['type'] = [
         '#type' => 'select',
+        '#empty_option' => $this->t('- Select -'),
         '#title' => $this->t('of type'),
         '#options' => $type_options,
         '#disabled' => $disbaled,
         '#default_value' => $bundle_type,
         '#prefix' => '<div id="' . $wrapper . '">',
-        '#suffix' => '</div>'
+        '#suffix' => '</div>',
       ];
     }
     // Target content type fieldset.
@@ -117,6 +189,14 @@ class CloneEntityType extends FormBase {
       '#type' => 'details',
       '#title' => $this->t('Target Entity details'),
       '#open' => TRUE,
+      '#states' => [
+        'visible' => [
+          'select[name="show[entity_type]"]' => ['!value' => ''],
+        ],
+        'enabled' => [
+          'select[name="show[type]"]' => ['!value' => ''],
+        ],
+      ],
     ];
     $form['target']['clone_bundle'] = [
       '#type' => 'textfield',
@@ -124,17 +204,22 @@ class CloneEntityType extends FormBase {
       '#required' => TRUE,
     ];
     $form['target']['clone_bundle_machine'] = [
-      '#type' => 'textfield',
+      '#type' => 'machine_name',
       '#title' => $this->t('Target bundle machine name'),
       '#required' => TRUE,
+      '#machine_name' => [
+        'exists' => $this->getEntityLookupCallback($entity_type),
+        'source' => ['target', 'clone_bundle'],
+      ],
     ];
     $form['target']['target_description'] = [
       '#type' => 'textarea',
       '#title' => $this->t('Description'),
       '#required' => FALSE,
     ];
+
     $form['message'] = [
-      '#markup' => $this->t('Note: Use <b>ENTITY TYPE CLONE</b> only to clone Content Type, Paragraph, Taxonomy.<br>'),
+      '#markup' => $this->t('Note: After cloning with <b>ENTITY TYPE CLONE</b> please check the cloned entity type before doing config export or save any content in it.<br>'),
     ];
     $form['submit'] = [
       '#type' => 'submit',
@@ -154,20 +239,6 @@ class CloneEntityType extends FormBase {
     return $form['displays']['show']['type'];
   }
 
-  /**
-   * {@inheritdoc}
-   */
-  public function validateForm(array &$form, FormStateInterface $form_state) {
-    // Get the form state values.
-    $values = $form_state->getValues();
-    $entity_type = $values['show']['entity_type'];
-    // Get the existing entity type machine names.
-    $entityTypesNames = $this->getMachineNamesof($entity_type);
-    if (($entityTypesNames) && (in_array($values['clone_bundle_machine'], $entityTypesNames))) {
-      $form_state->setErrorByName('clone_bundle_machine', $this->t('The machine name of the target entity type already exists.'));
-    }
-  }
-
   /**
    * {@inheritdoc}
    */
@@ -184,7 +255,7 @@ class CloneEntityType extends FormBase {
         'title' => $this->t('Cloning in process.'),
         'operations' => $this->cloneEntityType($form_state),
         'init_message' => $this->t('Performing clone operations...'),
-        'finished' => '\Drupal\entity_type_clone\Form\CloneEntityTypeData::cloneEntityTypeFinishedCallback',
+        'finished' => '\Drupal\entity_type_clone\CloneEntityType::cloneEntityTypeFinishedCallback',
         'error_message' => $this->t('Something went wrong. Please check the errors log.'),
       ];
       batch_set($batch);
@@ -193,10 +264,6 @@ class CloneEntityType extends FormBase {
 
   /**
    * Implements to perform batch operations.
-   *
-   * @param FormStateInterface $form_state
-   *
-   * @return array
    */
   public function cloneEntityType(FormStateInterface $form_state) {
     // Get the form state values.
@@ -204,47 +271,49 @@ class CloneEntityType extends FormBase {
     $entity_type = $values['show']['entity_type'];
     $operations = [];
     // Clone entity type operation.
-    $operations[] = ['\Drupal\entity_type_clone\Form\CloneEntityTypeData::cloneEntityTypeData', [$values]];
+    $operations[] = [
+      '\Drupal\entity_type_clone\CloneEntityType::cloneEntityTypeData',
+      [$values],
+    ];
     // Clone fields operations.
-    $fields = \Drupal::service('entity_field.manager')->getFieldDefinitions($entity_type, $values['show']['type']);
-    foreach ($fields as $field) {
-      if (!empty($field->getTargetBundle()) && !($entity_type === 'taxonomy_term' && $field->getName() === 'parent')) {
-        $data = ['field' => $field, 'values' => $values];
-        $operations[] = [
-          '\Drupal\entity_type_clone\Form\CloneEntityTypeData::cloneEntityTypeField',
-          [$data],
-        ];
+    $fields = $this->entityFieldManager->getFieldDefinitions($entity_type, $values['show']['type']);
+    if ($fields) {
+      foreach ($fields as $field) {
+        if (!empty($field->getTargetBundle()) && !($entity_type === 'taxonomy_term' && $field->getName() === 'parent')) {
+          $data = ['field' => $field, 'values' => $values];
+          $operations[] = [
+            '\Drupal\entity_type_clone\CloneEntityType::cloneEntityTypeField',
+            [$data],
+          ];
+        }
       }
     }
     return $operations;
   }
 
   /**
-   * Implement to get Machine Names of entity type.
+   * Returns the exists callback used for the clone_bundle_machine field.
    *
    * @param string $entity_type
+   *   The entity type for which to retrieve the exists callback.
    *
    * @return array
+   *   The exists callback as an array.
    */
-  protected function getMachineNamesof($entity_type) {
-    // Get the existing content type machine names.
-    $entityTypesNames = [];
-    if ($entity_type === 'node') {
-      $contentTypes = \Drupal::service('entity_type.manager')->getStorage('node_type')->loadMultiple();
-      $entityTypesNames = [];
-      foreach ($contentTypes as $contentType) {
-        $entityTypesNames[] = $contentType->id();
-      }
-    }
-    // Get the existing vocabulary machine names.
-    elseif ($entity_type === 'taxonomy_term') {
-      $taxonomyTypes = taxonomy_vocabulary_get_names();
-      foreach ($taxonomyTypes as $taxonomyType) {
-        $entityTypesNames[] = $taxonomyType;
-      }
+  protected function getEntityLookupCallback($entity_type) {
+    switch ($entity_type) {
+      case 'node':
+        return ['Drupal\node\Entity\NodeType', 'load'];
+
+      case 'paragraph':
+        return ['Drupal\paragraphs\Entity\ParagraphsType', 'load'];
+
+      case 'profile':
+        return ['Drupal\profile\Entity\ProfileType', 'load'];
+
+      case 'taxonomy_term':
+        return ['Drupal\taxonomy\Entity\Vocabulary', 'load'];
     }
-    // Return the result of entity type with machine names.
-    return $entityTypesNames;
   }
 
 }
diff --git a/src/Form/CloneRole.php b/src/Form/CloneRole.php
new file mode 100644
index 0000000000000000000000000000000000000000..4b57c5a18dabe956215a8d201d08bc0eb626d4b6
--- /dev/null
+++ b/src/Form/CloneRole.php
@@ -0,0 +1,126 @@
+<?php
+
+namespace Drupal\entity_type_clone\Form;
+
+use Drupal\Core\Entity\EntityTypeManager;
+use Drupal\Core\Form\FormBase;
+use Drupal\Core\Form\FormStateInterface;
+use Drupal\Core\Messenger\MessengerInterface;
+use Drupal\Core\Routing\RouteMatchInterface;
+use Drupal\user\Entity\Role;
+use Symfony\Component\DependencyInjection\ContainerInterface;
+
+/**
+ * Class for cloning role.
+ *
+ * @package Drupal\entity_type_clone\Form
+ */
+class CloneRole extends FormBase {
+
+  /**
+   * The entity type manager.
+   *
+   * @var \Drupal\Core\Entity\EntityTypeManager
+   */
+  protected $entityTypeManager;
+
+  /**
+   * The route match.
+   *
+   * @var \Drupal\Core\Routing\RouteMatchInterface
+   */
+  protected $routeMatch;
+
+  /**
+   * Constructs a DuplicateRoleForm object.
+   *
+   * @param \Drupal\Core\Entity\EntityTypeManager $entity_type_manager
+   *   The entity type manager.
+   * @param \Drupal\Core\Messenger\MessengerInterface $messenger
+   *   The messenger.
+   * @param \Drupal\Core\Routing\RouteMatchInterface $route_match
+   *   The route match.
+   */
+  public function __construct(EntityTypeManager $entity_type_manager, MessengerInterface $messenger, RouteMatchInterface $route_match) {
+    $this->entityTypeManager = $entity_type_manager;
+    $this->messenger = $messenger;
+    $this->routeMatch = $route_match;
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public static function create(ContainerInterface $container) {
+    return new static(
+      $container->get('entity_type.manager'),
+      $container->get('messenger'),
+      $container->get('current_route_match')
+    );
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function getFormId() {
+    return 'entity_clone_role_form';
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function buildForm(array $form, FormStateInterface $form_state, $note = NULL) {
+    $userRoles = user_role_names();
+    asort($userRoles);
+    foreach ($userRoles as $key => $value) {
+      $options[$key] = $value;
+    }
+    $form['role_id'] = [
+      '#type' => 'select',
+      '#empty_option' => $this->t('- Select -'),
+      '#title' => $this->t('Choose role'),
+      '#description' => $this->t('Select role to clone'),
+      '#options' => $options,
+      '#required' => TRUE,
+    ];
+    $form['label'] = [
+      '#type' => 'textfield',
+      '#title' => $this->t('New role'),
+      '#required' => TRUE,
+      '#size' => 40,
+      '#maxlength' => 40,
+      '#description' => $this->t('The name for the cloned role.'),
+    ];
+    $form['id'] = [
+      '#type' => 'machine_name',
+      '#default_value' => '',
+      '#required' => TRUE,
+      '#size' => 30,
+      '#maxlength' => 64,
+      '#machine_name' => [
+        'exists' => ['\Drupal\user\Entity\Role', 'load'],
+      ],
+    ];
+    $form['submit'] = [
+      '#type' => 'submit',
+      '#value' => $this->t('Clone'),
+    ];
+    return $form;
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function submitForm(array &$form, FormStateInterface $form_state) {
+    $new_role = Role::create([
+      'id' => $form_state->getValue('id'),
+      'label' => $form_state->getValue('label'),
+    ]);
+    $new_role->save();
+    /** @var \Drupal\user\RoleInterface $role */
+    $roleLoad = $this->entityTypeManager->getStorage('user_role')
+      ->load($form_state->getValue('role_id'));
+    user_role_grant_permissions($new_role->id(), $roleLoad->getPermissions());
+    $this->messenger->addStatus($this->t('Role %role_name has been cloned.', ['%role_name' => $form_state->getValue('role_id')]));
+  }
+
+}