   """
   @spec new(Config.t) :: {:ok, t} | :error
   def new(config) do
-    config = Config.parse_runtime_settings(config)
-
-    case valid_config?(config) do
-      true -> {:ok, _new(config)}
-      false -> :error
+    with config = Config.parse_runtime_settings(config),
+         true <- valid_config?(config),
+         repo = Repo.new(config[:repo_provider], config[:repo_owner], config[:repo_name]),
+         pipeline = %Pipeline{config: config, repo: repo, worker: config[:worker]} do
+      {:ok, pipeline}
+    else
+      _ -> :error
     end
-  end
-
-  @spec _new(Config.t) :: t
-  defp _new(config) do
-    repo = Repo.new(config[:repo_provider], config[:repo_owner], config[:repo_name])
-
-    %Pipeline{
-      config: config,
-      repo: repo,
-      worker: config[:worker]
-    }
   end
 
   @doc """

    end
  end

  defp via_tuple(%Pipeline{} = pipeline), do: via_tuple(pipeline.repo)
  defp via_tuple(%Repo{} = repo), do: via_tuple("#{repo}")
  defp via_tuple(name) when is_binary(name), do: {:via, :gproc, {:n, :l, {:pipeline, name}}}

  @doc """
  Creates a new pipeline with the given `config` settings.

    worker: nil
  ]

  @doc """
  Starts an agent linked to the current process to cache pipeline data.
  """
