   """
   defmacro h({ :/, _, [{ { :., _, [mod, fun] }, _, [] }, arity] }) do
     quote do
-      h(unquote(mod), unquote(fun), unquote(arity))
+      IEx.Helpers.__help__(unquote(mod), unquote(fun), unquote(arity))
     end
   end
 
   defmacro h({ { :., _, [mod, fun] }, _, [] }) do
     quote do
-      h(unquote(mod), unquote(fun))
+      IEx.Helpers.__help__(unquote(mod), unquote(fun))
     end
   end
 
   defmacro h({ :/, _, [{ fun, _, args }, arity] }) when args == [] or is_atom(args) do
     quote do
-      h(unquote(fun), unquote(arity))
+      IEx.Helpers.__help__(unquote(fun), unquote(arity))
     end
   end
 
   defmacro h({ name, _, args }) when args == [] or is_atom(args) do
     quote do
-      candidates = [unquote(__MODULE__), Kernel, Kernel.SpecialForms]
-
-      # If we got at least one :ok, final result will be :ok
-      Enum.reduce candidates, :not_found, fn(mod, flag) ->
-        ret = h(mod, unquote(name))
-        if flag == :ok do
-          :ok
-        else
-          ret
-        end
-      end
+      IEx.Helpers.__help__([unquote(__MODULE__), Kernel, Kernel.SpecialForms], unquote(name))
     end
   end
 
   defmacro h(other) do
     quote do
-      h(unquote(other), [])
-    end
-  end
-
-  defmacrop mfa_exported?(module, function, arity) do
-    quote do
-      function_exported?(unquote(module), unquote(function), unquote(arity)) or
-         macro_exported?(unquote(module), unquote(function), unquote(arity))
-    end
-  end
-
-  defp h_kernel(function, arity) do
-    if mfa_exported?(Kernel, function, arity) do
-      h(Kernel, function, arity)
-    else
-      h(Kernel.SpecialForms, function, arity)
-    end
-  end
-
-  @doc false
-  def h(:h, 1) do
-    h(__MODULE__, :h, 1)
-  end
-
-  def h(function, arity) when is_atom(function) and is_integer(arity) do
-    if mfa_exported?(__MODULE__, function, arity) do
-      h(__MODULE__, function, arity)
-    else
-      h_kernel(function, arity)
-    end
-  end
-
-  def h(module, []) when is_atom(module) do
+      IEx.Helpers.__help__(unquote(other))
+    end
+  end
+
+  # Handles documentation for modules
+  @doc false
+  def __help__(module) when is_atom(module) do
     case Code.ensure_loaded(module) do
       { :module, _ } ->
         case module.__info__(:moduledoc) do

    end
  end

  def h(module, function) when is_atom(module) and is_atom(function) do
    result = lc {{f, arity}, _line, _type, _args, doc } inlist module.__info__(:docs),
       f == function and doc != false do
      h(module, function, arity)
      IO.puts ""
    end
    if result != [] do
      :ok
    else
      :not_found
    end
  end

  def h(_, _) do
    IO.puts IO.ANSI.escape("%{red}Invalid h helper argument")
    h()
  end

  @doc false
  def h(module, function, arity) when is_atom(module) and is_atom(function) and is_integer(arity) do
    if docs = module.__info__(:docs) do
      doc =
        cond do
          d = find_doc(docs, function, arity)         -> d
          d = find_default_doc(docs, function, arity) -> d
          true                                        -> nil
        end

      if doc do
        IO.write "\n" <> print_signature(doc)
      else
        IO.puts IO.ANSI.escape("%{red}No docs for #{inspect module}.#{function}/#{arity} have been found")
      end
    else
      IO.puts IO.ANSI.escape("%{red}#{inspect module} was not compiled with docs")
    end
  end

  defp find_doc(docs, function, arity) do
    List.keyfind(docs, { function, arity }, 0)
  end

  defp find_default_doc(docs, function, min) do

  Shows the documentation for IEx.Helpers.
  """
  def h() do
    __help__(IEx.Helpers)
  end

  @doc """
