   @doc """
   Gets the current state of a `pipeline`.
   """
-  @spec get(pipeline) :: t | :undefined
+  @spec get(pipeline) :: t | no_return
   def get(pipeline) do
-    case whereis(pipeline) do
-      :undefined -> :undefined
-      pid -> Agent.get(pid, &(&1))
-    end
-  end
-
-  @doc """
-  Gets a value from a `pipeline` by `key`.
-  """
-  @spec get(pipeline, atom) :: any | :undefined
-  def get(pipeline, key) do
-    case whereis(pipeline) do
-      :undefined -> :undefined
-      pid -> Agent.get(pid, &Map.get(&1, key))
-    end
-  end
-
+    Agent.get(via_tuple(pipeline), &(&1))
+  end
+
+  @doc """
+  Gets a value from the `pipeline` by `key`.
+  """
+  @spec get(pipeline, atom) :: any | no_return
+  def get(pipeline, key) when is_atom(key) do
+    Agent.get(via_tuple(pipeline), &Map.get(&1, key))
+  end
+
+  @doc """
+  Fetches the current state of a `pipeline`.
+
+  Returns `{:ok, pipeline}` if the pipeline exists, otherwise `:error`.
+  """
   @spec fetch(pipeline) :: {:ok, t} | :error
-  defp fetch(pipeline) do
-    case get(pipeline) do
-      :undefined -> :error
-      pipeline -> {:ok, pipeline}
+  def fetch(pipeline) do
+    case Registry.lookup(Gullintanni.Registry, identify(pipeline)) do
+      [] -> :error
+      _ -> {:ok, get(pipeline)}
     end
   end
 

  @moduledoc """
  Defines a Gullintanni build pipeline.

  A pipeline is uniquely identified by repository and encapsulates the state
  necessary to coordinate builds and merges.
  """


  defp identify(%Pipeline{} = pipeline), do: identify(pipeline.repo)
  defp identify(%Repo{} = repo), do: identify("#{repo}")
  defp identify(name) when is_binary(name), do: name

  # Creates a new pipeline with the given `config` settings.
  #
