   end
 
   defp format_expansion([uniq], hint) do
-    hint = to_hint(uniq, hint)
-    uniq = if hint == "", do: to_uniq_entries(uniq), else: []
-    yes(hint, uniq)
+    case to_hint(uniq, hint) do
+      ""   -> yes("", to_uniq_entries(uniq))
+      hint -> yes(hint, [])
+    end
   end
 
   defp format_expansion([first|_]=entries, hint) do

  end

  defp reduce(expr) do
    Enum.reverse Enum.reduce [' ', '(', '[', '{'], expr, fn token, acc ->
      hd(:string.tokens(acc, token))
    end
  end


  end

  defp to_hint(%{kind: :module, name: name}, hint) do
    format_hint(name, hint) <> "."
  end

  defp to_hint(%{kind: :function, name: name}, hint) do
    format_hint(name, hint)
  end

  defp format_hint(name, hint) do
    hint_size = byte_size(hint)
    :binary.part(name, hint_size, byte_size(name) - hint_size)
  end
end
