   end
 
   defp format_expansion([uniq], hint) do
-    hint = Entry.to_hint(uniq, hint)
-    uniq = if hint == "", do: Entry.to_uniq_entries(uniq), else: []
+    hint = to_hint(uniq, hint)
+    uniq = if hint == "", do: to_uniq_entries(uniq), else: []
     yes(hint, uniq)
   end
 


  defrecord Mod, name: nil, type: nil
  defrecord Fun, name: nil, arities: []

  defprotocol Entry do
    @moduledoc false
    def to_entries(entry)
    def to_uniq_entries(entry)
    def to_hint(entry, hint)
  end

  defimpl Entry, for: Mod do
    @moduledoc false

    def to_entries(mod) do
      [mod.name]
    end

    def to_uniq_entries(_fun) do
      []
    end

    def to_hint(Mod[name: name], hint) do
      :binary.part(name, size(hint), size(name)-size(hint)) <> "."
    end
  end

  defimpl Entry, for: Fun do
    @moduledoc false

    def to_entries(fun) do
      lc a inlist fun.arities, do: "#{fun.name}/#{a}"
    end

    def to_uniq_entries(fun) do
      to_entries(fun)
    end

    def to_hint(Fun[name: name], hint) do
      :binary.part(name, size(hint), size(name)-size(hint))
    end
  end

  def expand([]) do
    funs = module_funs(IEx.Helpers) ++ module_funs(Kernel)

    length = byte_size(hint)
    prefix = :binary.longest_common_prefix(binary)
    if prefix in [0, length] do
      entries = Enum.reduce(entries, [], fn e, acc -> to_entries(e) ++ acc end)
      yes("", entries)
    else
      yes(:binary.part(first.name, prefix, length-prefix), [])
