diff --git a/inline_entity_form.module b/inline_entity_form.module
index 24af4d9..97534db 100644
--- a/inline_entity_form.module
+++ b/inline_entity_form.module
@@ -62,11 +62,10 @@ function inline_entity_form_reference_form($handler, $reference_form, &$form_sta
 
   $reference_form['#title'] = t('Add existing @type_singular', array('@type_singular' => $labels['singular']));
   $reference_form['entity_id'] = array(
-    '#type' => 'textfield',
+    '#type' => 'entity_autocomplete',
     '#title' => t('@label', array('@label' => ucwords($labels['singular']))),
-    '#autocomplete_route_name' => 'inline_entity_form.autocomplete',
-    '#autocomplete_route_parameters' => ['entity_type_id' => $instance->getTargetEntityTypeId(), 'field_name' => $instance->getName(), 'bundle' => $instance->getTargetBundle()],
-    '#element_validate' => array('_inline_entity_form_autocomplete_validate'),
+    '#target_type' => $instance->getSetting('target_type'),
+    '#selection_settings' => ['target_bundles' => $instance->getSetting('handler_settings')['target_bundles']],
     '#required' => TRUE,
     '#maxlength' => 255,
   );
@@ -112,20 +111,6 @@ function inline_entity_form_reference_form($handler, $reference_form, &$form_sta
 }
 
 /**
- * #element_validate callback for the IEF autocomplete field.
- */
-function _inline_entity_form_autocomplete_validate($element, FormStateInterface $form_state, $form) {
-  $value = '';
-  if (!empty($element['#value'])) {
-    // Take "label (entity id)', match the id from parenthesis.
-    if (preg_match("/.+\((\d+)\)/", $element['#value'], $matches)) {
-      $value = $matches[1];
-    }
-  }
-  $form_state->setValueForElement($element, $value);
-}
-
-/**
  * Validates the form for adding existing entities.
  *
  * @param $reference_form
diff --git a/inline_entity_form.routing.yml b/inline_entity_form.routing.yml
deleted file mode 100644
index 9456a00..0000000
--- a/inline_entity_form.routing.yml
+++ /dev/null
@@ -1,7 +0,0 @@
-inline_entity_form.autocomplete:
-  path: inline_entity_form/autocomplete/{entity_type_id}/{field_name}/{bundle}
-  defaults:
-    _controller: '\Drupal\inline_entity_form\Controller\AutocompleteController::autocomplete'
-    _title: 'Inline Entity Form Autocomplete'
-  requirements:
-    _access: 'TRUE'
diff --git a/src/Controller/AutocompleteController.php b/src/Controller/AutocompleteController.php
deleted file mode 100644
index eca5087..0000000
--- a/src/Controller/AutocompleteController.php
+++ /dev/null
@@ -1,102 +0,0 @@
-<?php
-
-/**
- * @file
- * Contains \Drupal\inline_entity_form\Controller\AutocompleteController.
- */
-
-namespace Drupal\inline_entity_form\Controller;
-
-use Drupal\Component\Utility\Html;
-use Drupal\Core\DependencyInjection\ContainerInjectionInterface;
-use Drupal\Core\Entity\EntityManagerInterface;
-use Drupal\Core\Entity\EntityReferenceSelection\SelectionPluginManagerInterface;
-use Symfony\Component\DependencyInjection\ContainerInterface;
-use Symfony\Component\HttpFoundation\JsonResponse;
-use Symfony\Component\HttpFoundation\Request;
-use Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException;
-
-/**
- * Defines the autocompletion controller method.
- */
-class AutocompleteController implements ContainerInjectionInterface {
-
-  /**
-   * Entity manager service.
-   *
-   * @var \Drupal\Core\Entity\EntityManagerInterface
-   */
-  protected $entityManager;
-
-  /**
-   * Selection manager service.
-   *
-   * @var \Drupal\Core\Entity\EntityReferenceSelection\SelectionPluginManagerInterface
-   */
-  protected $selectionManager;
-
-  /**
-   * Constructs a new AutocompleteController object.
-   *
-   * @param \Drupal\Core\Entity\EntityManagerInterface $entity_manager
-   */
-  public function __construct(EntityManagerInterface $entity_manager, SelectionPluginManagerInterface $selection_manager) {
-    $this->entityManager = $entity_manager;
-    $this->selectionManager = $selection_manager;
-  }
-
-  /**
-   * {@inheritdoc}
-   */
-  public static function create(ContainerInterface $container) {
-    return new static(
-      $container->get('entity.manager'),
-      $container->get('plugin.manager.entity_reference_selection')
-    );
-  }
-
-  /**
-   * Handles the response for inline entity form autocompletion.
-   *
-   * @return \Symfony\Component\HttpFoundation\JsonResponse
-   */
-  public function autocomplete($entity_type_id, $field_name, $bundle, Request $request) {
-    $string = $request->query->get('q');
-    $fields = $this->entityManager->getFieldDefinitions($entity_type_id, $bundle);
-    $widget = $this->entityManager
-      ->getStorage('entity_form_display')
-      ->load($entity_type_id . '.' . $bundle . '.default')
-      ->getComponent($field_name);
-    // The path was passed invalid parameters, or the string is empty.
-    // strlen() is used instead of empty() since '0' is a valid value.
-    if (!isset($fields[$field_name]) || !$widget || !strlen($string)) {
-      throw new AccessDeniedHttpException();
-    }
-
-    $field = $fields[$field_name];
-    $results = array();
-    if ($field->getType() == 'entity_reference') {
-      /** @var \Drupal\Core\Entity\EntityReferenceSelection\SelectionInterface $handler */
-      $handler = $this->selectionManager->getSelectionHandler($field);
-      $entity_labels = $handler->getReferenceableEntities($string, $widget['settings']['match_operator'], 10);
-
-      foreach ($entity_labels as $bundle => $labels) {
-        // Loop through each entity type, and autocomplete with its titles.
-        foreach ($labels as $entity_id => $label) {
-          // entityreference has already check_plain-ed the title.
-          $results[] = t('!label (!entity_id)', array('!label' => $label, '!entity_id' => $entity_id));
-        }
-      }
-    }
-
-    $matches = array();
-    foreach ($results as $result) {
-      // Strip things like starting/trailing white spaces, line breaks and tags.
-      $key = preg_replace('/\s\s+/', ' ', str_replace("\n", '', trim(Html::decodeEntities(strip_tags($result)))));
-      $matches[] = ['value' => $key, 'label' => '<div class="reference-autocomplete">' . $result . '</div>'];
-    }
-
-    return new JsonResponse($matches);
-  }
-
-}
diff --git a/src/Tests/InlineEntityFormComplexWebTest.php b/src/Tests/InlineEntityFormComplexWebTest.php
index f341bae..4429529 100644
--- a/src/Tests/InlineEntityFormComplexWebTest.php
+++ b/src/Tests/InlineEntityFormComplexWebTest.php
@@ -64,6 +64,8 @@ class InlineEntityFormComplexWebTest extends WebTestBase {
       'view own unpublished content',
       'administer content types',
       'administer node fields',
+      'create ief_test_all_bundles content',
+      'edit own ief_test_all_bundles content',
     ]);
     $this->drupalLogin($this->user);
 
@@ -306,6 +308,34 @@ class InlineEntityFormComplexWebTest extends WebTestBase {
   }
 
   /**
+   * Tests that when target_bundles is null we can reference all bundles.
+   */
+  public function testAllBundlesAllowed() {
+    $test_nodes = $this->createNodeForEveryBundle();
+    // Create ief_test_all_bundles with first reference node.
+    $node = $this->drupalCreateNode([
+      'type' => 'ief_test_all_bundles',
+      'title' => 'All bundles',
+      'all_bundles' => [1],
+    ]);
+    $this->drupalGet('node/' . $node->id() . '/edit');
+    // Add remaining test nodes.
+    for ($i = 2; $i <= count($test_nodes); $i++) {
+      $this->drupalPostAjaxForm(NULL, [], $this->getButtonName('//input[@type="submit" and @value="Add existing node"]'));
+      $edit["all_bundles[form][entity_id]"] = $test_nodes[$i] . ' (' . $i . ')';
+      $this->drupalPostAjaxForm(NULL, $edit, $this->getButtonName('//input[@type="submit" and @data-drupal-selector="edit-all-bundles-form-actions-ief-reference-save"]'));
+      $this->assertResponse(200, 'Adding new referenced entity was successful.');
+    }
+    $this->drupalPostForm(NULL, [], t('Save'));
+
+    $this->drupalGet('node/' . $node->id() . '/edit');
+
+    foreach ($test_nodes as $id => $title) {
+      $this->assertText($title);
+    }
+  }
+
+  /**
    * Creates ief_reference_type nodes which shall serve as reference nodes.
    *
    * @param int $numNodes
@@ -366,4 +396,20 @@ class InlineEntityFormComplexWebTest extends WebTestBase {
     return $retval;
   }
 
+  /**
+   * Creates a node for every node bundle.
+   *
+   * @return array
+   *   Array of node titles keyed by ids.
+   */
+  protected function createNodeForEveryBundle() {
+    $retval = [];
+    $bundles = $this->container->get('entity.manager')->getBundleInfo('node');
+    foreach ($bundles as $id => $value) {
+      $node = $this->drupalCreateNode(['type' => $id, 'title' => $value['label']]);
+      $retval[$node->id()] = $value['label'];
+    }
+    return $retval;
+  }
+
 }
diff --git a/tests/modules/inline_entity_form_test/config/install/core.entity_form_display.node.ief_test_all_bundles.default.yml b/tests/modules/inline_entity_form_test/config/install/core.entity_form_display.node.ief_test_all_bundles.default.yml
new file mode 100644
index 0000000..e565524
--- /dev/null
+++ b/tests/modules/inline_entity_form_test/config/install/core.entity_form_display.node.ief_test_all_bundles.default.yml
@@ -0,0 +1,53 @@
+langcode: und
+status: true
+dependencies:
+  config:
+    - node.type.ief_test_all_bundles
+id: node.ief_test_all_bundles.default
+targetEntityType: node
+bundle: ief_test_all_bundles
+mode: default
+content:
+  title:
+    type: string_textfield
+    weight: 0
+    settings:
+      size: 60
+      placeholder: ''
+    third_party_settings: {  }
+  created:
+    type: datetime_timestamp
+    weight: 10
+    settings: {  }
+    third_party_settings: {  }
+  promote:
+    type: boolean_checkbox
+    settings:
+      display_label: true
+    weight: 15
+    third_party_settings: {  }
+  sticky:
+    type: boolean_checkbox
+    settings:
+      display_label: true
+    weight: 16
+    third_party_settings: {  }
+  uid:
+    type: entity_reference_autocomplete
+    weight: 5
+    settings:
+      match_operator: CONTAINS
+      size: 60
+      placeholder: ''
+    third_party_settings: {  }
+  all_bundles:
+    weight: 30
+    settings:
+      match_operator: CONTAINS
+      allow_existing: true
+      override_labels: false
+      label_singular: ''
+      label_plural: ''
+    third_party_settings: {  }
+    type: inline_entity_form_complex
+hidden: {  }
diff --git a/tests/modules/inline_entity_form_test/config/install/field.field.node.ief_test_all_bundles.all_bundles.yml b/tests/modules/inline_entity_form_test/config/install/field.field.node.ief_test_all_bundles.all_bundles.yml
new file mode 100644
index 0000000..ba91c3e
--- /dev/null
+++ b/tests/modules/inline_entity_form_test/config/install/field.field.node.ief_test_all_bundles.all_bundles.yml
@@ -0,0 +1,30 @@
+langcode: und
+status: true
+dependencies:
+  config:
+    - field.storage.node.all_bundles
+    - node.type.ief_test_all_bundles
+  module:
+    - inline_entity_form_test
+    - entity_reference
+  enforced:
+    module:
+      - inline_entity_form_test
+id: node.ief_test_complex.all_bundles
+field_name: all_bundles
+entity_type: node
+bundle: ief_test_all_bundles
+label: All bundles
+description: 'Reference nodes from all available bundles.'
+required: true
+translatable: false
+default_value: {  }
+default_value_callback: ''
+settings:
+  handler: default:node
+  handler_settings:
+    target_bundles: null
+    sort:
+      field: _none
+third_party_settings: {  }
+field_type: entity_reference
diff --git a/tests/modules/inline_entity_form_test/config/install/field.storage.node.all_bundles.yml b/tests/modules/inline_entity_form_test/config/install/field.storage.node.all_bundles.yml
new file mode 100644
index 0000000..0a72137
--- /dev/null
+++ b/tests/modules/inline_entity_form_test/config/install/field.storage.node.all_bundles.yml
@@ -0,0 +1,22 @@
+langcode: und
+status: true
+dependencies:
+  module:
+    - inline_entity_form_test
+    - entity_reference
+    - node
+  enforced:
+    module:
+      - inline_entity_form_test
+id: node.all_bundles
+field_name: all_bundles
+entity_type: node
+type: entity_reference
+settings:
+  target_type: node
+module: entity_reference
+locked: false
+cardinality: -1
+translatable: false
+indexes: {  }
+persist_with_no_fields: false
diff --git a/tests/modules/inline_entity_form_test/config/install/node.type.ief_test_all_bundles.yml b/tests/modules/inline_entity_form_test/config/install/node.type.ief_test_all_bundles.yml
new file mode 100644
index 0000000..795fbcc
--- /dev/null
+++ b/tests/modules/inline_entity_form_test/config/install/node.type.ief_test_all_bundles.yml
@@ -0,0 +1,9 @@
+type: ief_test_all_bundles
+name: IEF test custom bundles
+description: 'Content type for IEF all bundles reference testing.'
+help: ''
+new_revision: false
+preview_mode: 1
+display_submitted: false
+status: true
+langcode: und
