 
   defp run(opts) when is_list(opts) do
     IO.puts "Interactive Elixir (#{System.version}) - press Ctrl+C to exit (type h() ENTER for help)"
-
+    evaluator = start_evaluator(opts)
+    loop(run_state(opts), evaluator, Process.monitor(evaluator))
+  end
+
+  defp start_evaluator(opts) do
     self_pid = self()
     self_leader = Process.group_leader
     evaluator = opts[:evaluator] ||
                 :proc_lib.start(IEx.Evaluator, :init, [:ack, self_pid, self_leader, opts])
     Process.put(:evaluator, evaluator)
-    loop(run_state(opts), evaluator, Process.monitor(evaluator))
+    evaluator
   end
 
   defp reset_loop(opts, evaluator, evaluator_ref) do

  """
  @spec start(list, {module, atom, [any]}) :: :ok
  def start(opts, {m, f, a}) do
    {pid, ref} = spawn_monitor(m, f, a)
    start_loop(opts, pid, ref)
  end

    receive do
      {:input, ^input, code} when is_binary(code) ->
        send evaluator, {:eval, self(), code, state}
        wait_eval(state, evaluator, evaluator_ref)
      {:input, ^input, {:error, :interrupted}} ->
        io_error "** (EXIT) interrupted"
        loop(%{state | cache: ''}, evaluator, evaluator_ref)
