         :orange,
         ", please update with `mix deps.update credo`"
       ]
-      |> warn
+      |> warn()
     end
-  end
-
-  def all_hex_versions(package_name) do
-    Hex.start
-    Hex.Registry.open!(Hex.Registry.Server)
-    Hex.Registry.prefetch([package_name])
-
-    Hex.Registry.versions(package_name)
   end
 
   def should_update?(all_versions, current) do
     latest = latest_version(all_versions, current)
-    Hex.Version.compare(current, latest) == :lt
+    Version.compare(current, latest) == :lt
   end
 
   defp latest_version(all_versions, default) do

    |> List.last
  end

  def pre_version?(version) do
    {:ok, version} = Hex.Version.parse(version)
    version.pre != []
  end

  defp warn(value) do
    IO.puts(:stderr, Bunt.format(value))
  end
end

defmodule Credo.CheckForUpdates do
  def run() do
    "credo"
    |> fetch_all_hex_versions()
    |> do_run()
  end

  defp do_run(nil), do: nil
  defp do_run(all_versions) do
    current = Credo.version

    if should_update?(all_versions, current) do
