diff --git a/inline_entity_form.module b/inline_entity_form.module
index 9a52836..79b2dcc 100644
--- a/inline_entity_form.module
+++ b/inline_entity_form.module
@@ -551,38 +551,3 @@ function theme_inline_entity_form_entity_table($variables) {
     return $renderer->render($table);
   }
 }
-
-/**
- * Move form elements into fieldsets for presentation purposes.
- *
- * Inline forms use #tree = TRUE to keep their values in a hierarchy for
- * easier storage. Moving the form elements into fieldsets during form building
- * would break up that hierarchy, so it's not an option for Field API fields.
- * Therefore, we wait until the pre_render stage, where any changes we make
- * affect presentation only and aren't reflected in $form_state->getValues().
- */
-function inline_entity_form_pre_render_add_fieldset_markup($form) {
-  $sort = array();
-  foreach (Element::children($form) as $key) {
-    $element = $form[$key];
-    // In our form builder functions, we added an arbitrary #fieldset property
-    // to any element that belongs in a fieldset. If this form element has that
-    // property, move it into its fieldset.
-    if (isset($element['#fieldset']) && isset($form[$element['#fieldset']])) {
-      $form[$element['#fieldset']][$key] = $element;
-      // Remove the original element this duplicates.
-      unset($form[$key]);
-      // Mark the fieldset for sorting.
-      if (!in_array($key, $sort)) {
-        $sort[] = $element['#fieldset'];
-      }
-    }
-  }
-
-  // Sort all fieldsets, so that element #weight stays respected.
-  foreach ($sort as $key) {
-    uasort($form[$key], 'element_sort');
-  }
-
-  return $form;
-}
diff --git a/src/InlineEntityForm/EntityInlineEntityFormHandler.php b/src/InlineEntityForm/EntityInlineEntityFormHandler.php
index e738a17..cff7c28 100644
--- a/src/InlineEntityForm/EntityInlineEntityFormHandler.php
+++ b/src/InlineEntityForm/EntityInlineEntityFormHandler.php
@@ -238,11 +238,8 @@ class EntityInlineEntityFormHandler implements InlineEntityFormHandlerInterface
     }
 
     // TODO - this is field-only part of the code. Figure out how to refactor.
-    if ($child_form_state->get('inline_entity_form')) {
-      foreach ($child_form_state->get('inline_entity_form') as $id => $data) {
-        $data['entity'] = $entity_form['#entity'];
-        $form_state->set(['inline_entity_form', $id], $data);
-      }
+    if ($child_form_state->has(['inline_entity_form', $entity_form['#ief_id']])) {
+      $form_state->set(['inline_entity_form', $entity_form['#ief_id'], 'entity'], $entity_form['#entity']);
     }
 
   }
diff --git a/src/Plugin/Field/FieldWidget/InlineEntityFormBase.php b/src/Plugin/Field/FieldWidget/InlineEntityFormBase.php
index a24a63b..98f3eb7 100644
--- a/src/Plugin/Field/FieldWidget/InlineEntityFormBase.php
+++ b/src/Plugin/Field/FieldWidget/InlineEntityFormBase.php
@@ -7,11 +7,13 @@
 
 namespace Drupal\inline_entity_form\Plugin\Field\FieldWidget;
 
+use Drupal\Core\Entity\EntityInterface;
 use Drupal\Core\Entity\EntityManagerInterface;
 use Drupal\Core\Field\FieldDefinitionInterface;
 use Drupal\Core\Field\WidgetBase;
 use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Plugin\ContainerFactoryPluginInterface;
+use Drupal\Core\Render\Element;
 use Symfony\Component\DependencyInjection\ContainerInterface;
 
 /**
@@ -265,4 +267,172 @@ abstract class InlineEntityFormBase extends WidgetBase implements ContainerFacto
     }
   }
 
+  /**
+   * Checks whether we can build entity form at all.
+   *
+   * - Is IEF handler loaded?
+   * - Are we on a "real" entity form and not on default value widget?
+   *
+   * @param FormStateInterface $form_state
+   *   Form state.
+   *
+   * @return bool
+   *   TRUE if we are able to proceed with form build and FALSE if not.
+   */
+  protected function canBuildForm(FormStateInterface $form_state) {
+    if ($this->isDefaultValueWidget($form_state)) {
+      return FALSE;
+    }
+
+    if (!$this->iefHandler) {
+      return FALSE;
+    }
+
+    return TRUE;
+  }
+
+  /**
+   * Gets inline entity form element.
+   *
+   * @param $operation
+   *   Operation (i.e. 'add' or 'edit').
+   * @param $target_type
+   *   Target entity type.
+   * @param $language
+   *   Entity langcode.
+   * @param array $parents
+   *   Array of parent element names.
+   * @param EntityInterface $entity
+   *   Optional entity object.
+   * @param bool $save_entity
+   *   IEF will attempt to save entity after attaching all field values if set to
+   *   TRUE. Defaults to FALSE.
+   *
+   * @return array
+   *   IEF form element structure.
+   */
+  protected function getInlineEntityForm($operation, $target_type, $language, array $parents, $bundle = NULL, EntityInterface $entity = NULL, $save_entity = FALSE) {
+    $ief = [
+      '#type' => 'inline_entity_form',
+      '#op' => $operation,
+      '#save_entity' => $save_entity,
+      // Used by Field API and controller methods to find the relevant
+      // values in $form_state.
+      '#parents' => $parents,
+      '#entity_type' => $target_type,
+      // Pass the langcode of the parent entity,
+      '#language' => $language,
+      // Labels could be overridden in field widget settings. We won't have
+      // access to those in static callbacks (#process, ...) so let's add
+      // them here.
+      '#ief_labels' => $this->labels(),
+      // Identifies the IEF widget to which the form belongs.
+      '#ief_id' => $this->getIefId(),
+      // Add the pre_render callback that powers the #fieldset form element key,
+      // which moves the element to the specified fieldset without modifying its
+      // position in $form_state->get('values').
+      '#pre_render' => [[get_class($this), 'addFieldsetMarkup']],
+      '#process' => [
+        ['\Drupal\inline_entity_form\Element\InlineEntityForm', 'processEntityForm'],
+        [get_class($this), 'addIefSubmitCallbacks'],
+      ]
+    ];
+
+    if ($entity) {
+      // Store the entity on the form, later modified in the controller.
+      $ief['#entity'] = $entity;
+    }
+
+    if ($bundle) {
+      $ief['#bundle'] = $bundle;
+    }
+
+    return $ief;
+  }
+
+  /**
+   * Adds submit callbacks to the inline entity form.
+   *
+   * @param array $element
+   *   Form array structure.
+   */
+  public static function addIefSubmitCallbacks($element) {
+    $element['#ief_element_submit'][] = [get_called_class(), 'submitSaveEntity'];
+    return $element;
+  }
+
+  /**
+   * Pre-render callback: Move form elements into fieldsets for presentation purposes.
+   *
+   * Inline forms use #tree = TRUE to keep their values in a hierarchy for
+   * easier storage. Moving the form elements into fieldsets during form building
+   * would break up that hierarchy, so it's not an option for Field API fields.
+   * Therefore, we wait until the pre_render stage, where any changes we make
+   * affect presentation only and aren't reflected in $form_state->getValues().
+   */
+  public static function addFieldsetMarkup($form) {
+    $sort = [];
+    foreach (Element::children($form) as $key) {
+      $element = $form[$key];
+      // In our form builder functions, we added an arbitrary #fieldset property
+      // to any element that belongs in a fieldset. If this form element has that
+      // property, move it into its fieldset.
+      if (isset($element['#fieldset']) && isset($form[$element['#fieldset']])) {
+        $form[$element['#fieldset']][$key] = $element;
+        // Remove the original element this duplicates.
+        unset($form[$key]);
+        // Mark the fieldset for sorting.
+        if (!in_array($key, $sort)) {
+          $sort[] = $element['#fieldset'];
+        }
+      }
+    }
+
+    // Sort all fieldsets, so that element #weight stays respected.
+    foreach ($sort as $key) {
+      uasort($form[$key], 'element_sort');
+    }
+
+    return $form;
+  }
+
+  /**
+   * Marks created/edited entity with "needs save" flag.
+   *
+   * Note that at this point the entity is not yet saved, since the user might
+   * still decide to cancel the parent form.
+   *
+   * @param $entity_form
+   *  The form of the entity being managed inline.
+   * @param $form_state
+   *   The form state of the parent form.
+   */
+  public static function submitSaveEntity($entity_form, FormStateInterface $form_state) {
+    $ief_id = $entity_form['#ief_id'];
+    $entity = $entity_form['#entity'];
+
+    if ($entity_form['#op'] == 'add') {
+      // Determine the correct weight of the new element.
+      $weight = 0;
+      $entities = $form_state->get(['inline_entity_form', $ief_id, 'entities']);
+      if (!empty($entities)) {
+        $weight = max(array_keys($entities)) + 1;
+      }
+      // Add the entity to form state, mark it for saving, and close the form.
+      $entities[] = array(
+        'entity' => $entity,
+        '_weight' => $weight,
+        'form' => NULL,
+        'needs_save' => TRUE,
+      );
+      $form_state->set(['inline_entity_form', $ief_id, 'entities'], $entities);
+    }
+    else {
+      $delta = $entity_form['#ief_row_delta'];
+      $entities = $form_state->get(['inline_entity_form', $ief_id, 'entities']);
+      $entities[$delta]['entity'] = $entity;
+      $entities[$delta]['needs_save'] = TRUE;
+      $form_state->set(['inline_entity_form', $ief_id, 'entities'], $entities);
+    }
+  }
 }
diff --git a/src/Plugin/Field/FieldWidget/InlineEntityFormMultiple.php b/src/Plugin/Field/FieldWidget/InlineEntityFormMultiple.php
index f3ed68f..d92a922 100644
--- a/src/Plugin/Field/FieldWidget/InlineEntityFormMultiple.php
+++ b/src/Plugin/Field/FieldWidget/InlineEntityFormMultiple.php
@@ -10,6 +10,7 @@ namespace Drupal\inline_entity_form\Plugin\Field\FieldWidget;
 use Drupal\Component\Utility\NestedArray;
 use Drupal\Component\Utility\SortArray;
 use Drupal\Core\Entity\EntityManagerInterface;
+use Drupal\Core\Extension\ModuleHandlerInterface;
 use Drupal\Core\Field\FieldDefinitionInterface;
 use Drupal\Core\Field\FieldItemListInterface;
 use Drupal\Core\Field\WidgetBase;
@@ -33,20 +34,61 @@ use Symfony\Component\DependencyInjection\ContainerInterface;
 class InlineEntityFormMultiple extends InlineEntityFormBase implements ContainerFactoryPluginInterface {
 
   /**
+   * Module handler service.
+   *
+   * @var \Drupal\Core\Extension\ModuleHandlerInterface
+   */
+  protected $moduleHandler;
+
+  /**
+   * Constructs a InlineEntityFormBase object.
+   *
+   * @param array $plugin_id
+   *   The plugin_id for the widget.
+   * @param mixed $plugin_definition
+   *   The plugin implementation definition.
+   * @param \Drupal\Core\Field\FieldDefinitionInterface $field_definition
+   *   The definition of the field to which the widget is associated.
+   * @param array $settings
+   *   The widget settings.
+   * @param array $third_party_settings
+   *   Any third party settings.
+   * @param \Drupal\Core\Entity\EntityManager $entity_manager
+   *   Entity manager service.
+   * @param \Drupal\Core\Extension\ModuleHandlerInterface $module_handler
+   *   Module handler service.
+   */
+  public function __construct($plugin_id, $plugin_definition, FieldDefinitionInterface $field_definition, array $settings, array $third_party_settings, EntityManagerInterface $entity_manager, ModuleHandlerInterface $module_handler) {
+    parent::__construct($plugin_id, $plugin_definition, $field_definition, $settings, $third_party_settings, $entity_manager);
+    $this->moduleHandler = $module_handler;
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) {
+    return new static(
+      $plugin_id,
+      $plugin_definition,
+      $configuration['field_definition'],
+      $configuration['settings'],
+      $configuration['third_party_settings'],
+      $container->get('entity.manager'),
+      $container->get('module_handler')
+    );
+  }
+
+  /**
    * {@inheritdoc}
    */
   public function formElement(FieldItemListInterface $items, $delta, array $element, array &$form, FormStateInterface $form_state) {
-    if ($this->isDefaultValueWidget($form_state)) {
+    if (!$this->canBuildForm($form_state)) {
       return $element;
     }
 
     $settings = $this->getFieldSettings();
     $cardinality = $this->fieldDefinition->getFieldStorageDefinition()->getCardinality();
 
-    if (!$this->iefHandler) {
-      return $element;
-    }
-
     // Get the entity type labels for the UI strings.
     $labels = $this->labels();
 
@@ -133,7 +175,7 @@ class InlineEntityFormMultiple extends InlineEntityFormBase implements Container
     );
 
     // Get the fields that should be displayed in the table.
-    $target_bundles = isset($settings['handler_settings']['target_bundles']) ? $settings['handler_settings']['target_bundles'] : array();
+    $target_bundles = isset($settings['handler_settings']['target_bundles']) ? $settings['handler_settings']['target_bundles'] : [];
     $fields = $this->iefHandler->tableFields($target_bundles);
     $context = array(
       'parent_entity_type' => $this->fieldDefinition->getTargetEntityTypeId(),
@@ -142,7 +184,7 @@ class InlineEntityFormMultiple extends InlineEntityFormBase implements Container
       'entity_type' => $settings['target_type'],
       'allowed_bundles' => $target_bundles,
     );
-    \Drupal::moduleHandler()->alter('inline_entity_form_table_fields', $fields, $context);
+    $this->moduleHandler->alter('inline_entity_form_table_fields', $fields, $context);
     $element['entities']['#table_fields'] = $fields;
 
     $weight_delta = max(ceil(count($entities) * 1.2), 50);
@@ -174,37 +216,18 @@ class InlineEntityFormMultiple extends InlineEntityFormBase implements Container
           $element['entities'][$key]['form'] = [
             '#type' => 'container',
             '#attributes' => ['class' => ['ief-form', 'ief-form-row']],
-            'inline_entity_form' => [
-              '#type' => 'inline_entity_form',
-              '#op' => $value['form'],
-              '#save_entity' => FALSE,
-              // Used by Field API and controller methods to find the relevant
-              // values in $form_state.
-              '#parents' => array_merge($parents, ['inline_entity_form', 'entities', $key, 'form']),
-              // Store the entity on the form, later modified in the controller.
-              '#entity' => $entity,
-              '#entity_type' => $settings['target_type'],
-              // Pass the langcode of the parent entity,
-              '#language' => $parent_langcode,
-              // Labels could be overridden in field widget settings. We won't have
-              // access to those in static callbacks (#process, ...) so let's add
-              // them here.
-              '#ief_labels' => $this->labels(),
-              // Identifies the IEF widget to which the form belongs.
-              '#ief_id' => $this->getIefId(),
-              // Identifies the table row to which the form belongs.
-              '#ief_row_delta' => $key,
-              // Add the pre_render callback that powers the #fieldset form element key,
-              // which moves the element to the specified fieldset without modifying its
-              // position in $form_state->get('values').
-              '#pre_render' => ['inline_entity_form_pre_render_add_fieldset_markup'],
-              '#process' => [
-                ['\Drupal\inline_entity_form\Element\InlineEntityForm', 'processEntityForm'],
-                [get_class($this), 'buildEntityFormActions'],
-                [get_class($this), 'addIefSubmitCallbacks'],
-              ]
-            ]
+            'inline_entity_form' => $this->getInlineEntityForm(
+              $value['form'],
+              $settings['target_type'],
+              $parent_langcode,
+              array_merge($parents,  ['inline_entity_form', 'entities', $key, 'form']),
+              $entity->bundle(),
+              $entity
+            ),
           ];
+          // Identifies the table row to which the form belongs.
+          $element['entities'][$key]['form']['inline_entity_form']['#ief_row_delta'] = $delta;
+          $element['entities'][$key]['form']['inline_entity_form']['#process'][] = [get_class($this), 'buildEntityFormActions'];
         }
         elseif ($value['form'] == 'remove') {
           $element['entities'][$key]['form'] = [
@@ -381,36 +404,15 @@ class InlineEntityFormMultiple extends InlineEntityFormBase implements Container
         $element['form'] = [
           '#type' => 'fieldset',
           '#attributes' => ['class' => ['ief-form', 'ief-form-bottom']],
-          'inline_entity_form' => [
-            '#type' => 'inline_entity_form',
-            '#op' => 'add',
-            '#save_entity' => FALSE,
-            '#entity_type' => $settings['target_type'],
-            '#bundle' => $this->determineBundle($form_state),
-            '#language' => $parent_langcode,
-            // Labels could be overridden in field widget settings. We won't have
-            // access to those in static callbacks (#process, ...) so let's add
-            // them here.
-            '#ief_labels' => $this->labels(),
-            // Identifies the IEF widget to which the form belongs.
-            '#ief_id' => $this->getIefId(),
-            // Used by Field API and controller methods to find the relevant
-            // values in $form_state.
-            '#parents' => array_merge($parents, ['inline_entity_form']),
-            // Add the pre_render callback that powers the #fieldset form element key,
-            // which moves the element to the specified fieldset without modifying its
-            // position in $form_state->get('values').
-            '#pre_render' => ['inline_entity_form_pre_render_add_fieldset_markup'],
-            // We need to add our own #process callback that adds action elements,
-            // but still keep default callback which makes sure everything will
-            // actually work.
-            '#process' => [
-              ['\Drupal\inline_entity_form\Element\InlineEntityForm', 'processEntityForm'],
-              [get_class($this), 'buildEntityFormActions'],
-              [get_class($this), 'addIefSubmitCallbacks'],
-            ],
-          ],
+          'inline_entity_form' => $this->getInlineEntityForm(
+            'add',
+            $settings['target_type'],
+            $parent_langcode,
+            array_merge($parents, ['inline_entity_form']),
+            $this->determineBundle($form_state)
+          )
         ];
+        $element['form']['inline_entity_form']['#process'][] = [get_class($this), 'buildEntityFormActions'];
 
         // Hide the cancel button if the reference field is required but
         // contains no values. That way the user is forced to create an entity.
@@ -437,7 +439,7 @@ class InlineEntityFormMultiple extends InlineEntityFormBase implements Container
           // Add the pre_render callback that powers the #fieldset form element key,
           // which moves the element to the specified fieldset without modifying its
           // position in $form_state->get('values').
-          '#pre_render' => ['inline_entity_form_pre_render_add_fieldset_markup'],
+          '#pre_render' => [[get_class($this), 'addFieldsetMarkup']],
         );
 
         $element['form'] += inline_entity_form_reference_form($this->iefHandler, $element['form'], $form_state);
@@ -552,17 +554,6 @@ class InlineEntityFormMultiple extends InlineEntityFormBase implements Container
   }
 
   /**
-   * Adds submit callbacks to the inline entity form.
-   *
-   * @param array $element
-   *   Form array structure.
-   */
-  public static function addIefSubmitCallbacks($element) {
-    $element['#ief_element_submit'][] = [get_called_class(), 'submitSaveEntity'];
-    return $element;
-  }
-
-  /**
    * Adds actions to the inline entity form.
    *
    * @param array $element
@@ -804,46 +795,6 @@ class InlineEntityFormMultiple extends InlineEntityFormBase implements Container
   }
 
   /**
-   * Marks created/edited entity with "needs save" flag.
-   *
-   * Note that at this point the entity is not yet saved, since the user might
-   * still decide to cancel the parent form.
-   *
-   * @param $entity_form
-   *  The form of the entity being managed inline.
-   * @param $form_state
-   *   The form state of the parent form.
-   */
-  public static function submitSaveEntity($entity_form, FormStateInterface $form_state) {
-    $ief_id = $entity_form['#ief_id'];
-    $entity = $entity_form['#entity'];
-
-    if ($entity_form['#op'] == 'add') {
-      // Determine the correct weight of the new element.
-      $weight = 0;
-      $entities = $form_state->get(['inline_entity_form', $ief_id, 'entities']);
-      if (!empty($entities)) {
-        $weight = max(array_keys($entities)) + 1;
-      }
-      // Add the entity to form state, mark it for saving, and close the form.
-      $entities[] = array(
-        'entity' => $entity,
-        '_weight' => $weight,
-        'form' => NULL,
-        'needs_save' => TRUE,
-      );
-      $form_state->set(['inline_entity_form', $ief_id, 'entities'], $entities);
-    }
-    else {
-      $delta = $entity_form['#ief_row_delta'];
-      $entities = $form_state->get(['inline_entity_form', $ief_id, 'entities']);
-      $entities[$delta]['entity'] = $entity;
-      $entities[$delta]['needs_save'] = TRUE;
-      $form_state->set(['inline_entity_form', $ief_id, 'entities'], $entities);
-    }
-  }
-
-  /**
    * Updates entity weights based on their weights in the widget.
    */
   public static function updateRowWeights($element, FormStateInterface $form_state, $form) {
diff --git a/src/Plugin/Field/FieldWidget/InlineEntityFormSingle.php b/src/Plugin/Field/FieldWidget/InlineEntityFormSingle.php
index f255e39..cbc3df4 100644
--- a/src/Plugin/Field/FieldWidget/InlineEntityFormSingle.php
+++ b/src/Plugin/Field/FieldWidget/InlineEntityFormSingle.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\inline_entity_form\Plugin\Field\FieldWidget;
 
+use Drupal\Core\Field\FieldDefinitionInterface;
 use Drupal\Core\Field\FieldItemListInterface;
 use Drupal\Core\Field\WidgetBase;
 use Drupal\Core\Form\FormStateInterface;
@@ -29,9 +30,108 @@ class InlineEntityFormSingle extends InlineEntityFormBase {
    * {@inheritdoc}
    */
   public function formElement(FieldItemListInterface $items, $delta, array $element, array &$form, FormStateInterface $form_state) {
-    $ief_id = $this->fieldDefinition;
+    if (!$this->canBuildForm($form_state)) {
+      return $element;
+    }
 
+    $this->setIefId(sha1($items->getName() . '-ief-single'));
+    $entity_type = $this->getFieldSettings()['target_type'];
+
+    $element['#type'] = 'fieldset';
+    if ($items->target_id) {
+      $entity = $this->entityManager->getStorage($entity_type)->load($items->target_id);
+      if ($entity) {
+        $element['inline_entity_form'] = $this->getInlineEntityForm(
+          'edit',
+          $entity_type,
+          $items->getParent()->getValue()->language()->getId(),
+          array_merge($element['#field_parents'], [
+            $items->getName(),
+            'inline_entity_form'
+          ]),
+          reset($this->getFieldSettings()['handler_settings']['target_bundles']),
+          $entity,
+          TRUE
+        );
+      }
+      else {
+        $element['warning']['#markup'] = t('Unable to load referenced entity.');
+      }
+    }
+    else {
+      $element['inline_entity_form'] = $this->getInlineEntityForm(
+        'add',
+        $entity_type,
+        $items->getParent()->getValue()->language()->getId(),
+        array_merge($element['#field_parents'], [
+          $items->getName(),
+          'inline_entity_form'
+        ]),
+        reset($this->getFieldSettings()['handler_settings']['target_bundles']),
+        NULL,
+        TRUE
+      );
+    }
     return $element;
   }
 
+  /**
+   * {@inheritdoc}
+   */
+  public function extractFormValues(FieldItemListInterface $items, array $form, FormStateInterface $form_state) {
+    if ($this->isDefaultValueWidget($form_state)) {
+      $items->filterEmptyItems();
+      return;
+    }
+
+    $this->setIefId(sha1($items->getName() . '-ief-single'));
+
+    /** @var \Drupal\Core\Entity\EntityInterface $entity */
+    if (!$entity = $form_state->get(['inline_entity_form', $this->getIefId(), 'entity'])) {
+      return;
+    }
+
+    if (!$entity->id()) {
+      return;
+    }
+
+    $field_name = $this->fieldDefinition->getName();
+    $values = [
+      [
+        'entity' => $entity,
+      ]
+    ];
+
+    // Let the widget massage the submitted values.
+    $values = $this->massageFormValues($values, $form, $form_state);
+
+    // Assign the values and remove the empty ones.
+    $items->setValue($values);
+    $items->filterEmptyItems();
+
+    // Put delta mapping in $form_state, so that flagErrors() can use it.
+    $field_state = WidgetBase::getWidgetState($form['#parents'], $field_name, $form_state);
+    foreach ($items as $delta => $item) {
+      $field_state['original_deltas'][$delta] = isset($item->_original_delta) ? $item->_original_delta : $delta;
+      unset($item->_original_delta, $item->_weight);
+    }
+
+    WidgetBase::setWidgetState($form['#parents'], $field_name, $form_state, $field_state);
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public static function isApplicable(FieldDefinitionInterface $field_definition) {
+    if ($field_definition->getFieldStorageDefinition()->getCardinality() > 1) {
+      return FALSE;
+    }
+
+    if (count($field_definition->getSettings()['handler_settings']['target_bundles']) != 1) {
+      return FALSE;
+    }
+
+    return TRUE;
+  }
+
 }
