   def init(handlers) do
     retry_ms  = Application.get_env(:discovery, :retry_connect_ms, 5000)
     {:ok, em} = GenEvent.start_link
-    Enum.each handlers, fn
+
+    registered_handlers = Enum.map handlers, fn
       {module, args} ->
-        register_handler(em, module, args)
+        {:ok, ref} = register_handler(em, module, args)
+        {{module, ref}, args}
       module when is_atom(module) ->
-        register_handler(em, module)
-    end
-    {:ok, %{retry_ms: retry_ms, timers: %{}, em: em}}
-  end
-
-  def handle_call({:add_handler, module, args}, _, %{em: em} = state) do
+        {:ok, ref} = register_handler(em, module)
+        {{module, ref}, []}
+    end
+
+    handler_map = Enum.into registered_handlers, HashDict.new
+
+    {:ok, %{retry_ms: retry_ms, timers: %{}, em: em, handlers: handler_map}}
+  end
+
+  def handle_call({:add_handler, module, args}, _, %{em: em, handlers: handlers} = state) do
     case register_handler(em, module, args) do
       {:ok, ref} ->
-        {:reply, {:ok, {module, ref}}, state}
+        {:reply, {:ok, {module, ref}}, %{state | handlers: HashDict.put(handlers, {module, ref}, args)}}
       error ->
         {:reply, error, state}
     end

    end
  end

  def handle_call({:remove_handler, module, ref}, _, %{em: em} = state) do
    {:reply, unregister_handler(em, module, ref), state}
  end

  def handle_info({:retry_connect, node}, state) do

    {:noreply, new_state}
  end

  def handle_info({:nodedown, node}, %{em: em} = state) do
    Logger.warn "Unexpected disconnect from node: #{node}"
    NodeConnector.Handler.notify_disconnect(em, node)

    case Directory.has_node?(node) do
      true ->
        new_state = attempt_connect(node, state)
