diff --git a/references_dialog.module b/references_dialog.module
index 9ad6435..82086a2 100644
--- a/references_dialog.module
+++ b/references_dialog.module
@@ -692,5 +692,23 @@ function references_dialog_get_admin_path($entity_type, $op, $bundle = NULL, $en
  * the references dialog.
  */
 function theme_references_dialog_links($links) {
-  return theme('links', array('links' => $links, 'attributes' => array('class' => 'references-dialog-links')));
+  $links = array_filter($links);
+  $ctools_links_themed = NULL;
+  if (module_exists('ctools') && count($links) > variable_get('references_dialog_links_threshold', 3)) {
+    $ctools_links = array();
+    $non_ctools_links = array();
+    foreach ($links as $link) {
+      switch (TRUE) {
+        case strpos($link['href'], 'references-dialog/search') === 0:
+          $non_ctools_links[] = $link;
+          break;
+        default:
+          $ctools_links[] = $link;
+          break;
+      }
+      $links = $non_ctools_links;
+    }
+    $ctools_links_themed = theme('links__ctools_dropbutton', array('links' => $ctools_links, 'title' => t('Create'), 'attributes' => array('class' => array('references-dialog-links'))));
+  }
+  return $ctools_links_themed . theme('links', array('links' => $links, 'attributes' => array('class' => array('references-dialog-links'))));
 }
