   end
 
   defp start(%{manager: manager, duration: duration, mode: mode} = stream) do
-    pid = whereis(manager)
-    ref = Process.monitor(pid)
-
-    try do
-      :ok = GenEvent.add_handler(pid, {__MODULE__, ref},
-                                 {mode, self(), ref}, monitor: true)
-    catch
-      :exit, :noproc -> exit({:noproc, {__MODULE__, :start, [stream]}})
-    end
+    {pid, ref} =
+      try do
+        pid = whereis(manager)
+        ref = Process.monitor(pid)
+        :ok = GenEvent.add_handler(pid, {__MODULE__, ref},
+                                   {mode, self(), ref}, monitor: true)
+        {pid, ref}
+      catch
+        :exit, reason -> exit({reason, {__MODULE__, :start, [stream]}})
+      end
 
     timer = cond do
       duration == :infinity -> nil


  @doc false
  def handle_event(event, {mode, pid, ref} = state) when mode in [:sync, :ack] do
    # TODO: The process is already monitored by the GenEvent
    # but we don't have access to the reference in here.
    sync = Process.monitor(pid)
    send pid, {ref, sync, event}
    receive do

  # If we reach this branch, the handler was not removed yet,
  # so we trigger a request for doing so.
  defp stop(stream, {pid, ref, _} = acc) do
    spawn(fn -> GenEvent.remove_handler(pid, {__MODULE__, ref}, :shutdown) end)
    stop(stream, {:removed, acc})
  end

