     repositories = Poison.decode!(raw)["repositories"]
     |> Enum.map(&BorsNG.GitHub.Repo.from_json!/1)
     |> Enum.concat(append)
-    next_headers = headers
-    |> Enum.filter(&(elem(&1, 0) == "Link"))
-    |> Enum.map(&(ExLinkHeader.parse!(elem(&1, 1))))
-    |> Enum.filter(&!is_nil(&1.next))
+    next_headers = get_next_headers(headers)
     case next_headers do
       [] -> repositories
       [next] -> get_installation_repos_!(token, next.next.url, repositories)

  @type tconn :: BorsNG.GitHub.tconn
  @type ttoken :: BorsNG.GitHub.ttoken
  @type trepo :: BorsNG.GitHub.trepo
  @type tpr :: BorsNG.GitHub.tpr

  @typedoc """

      "#{site()}/repositories/#{repo_xref}/#{path}",
      [{"Authorization", "token #{token}"}] ++ headers,
      params)
  end

  defp get_next_headers(headers) do
    headers
    |> Enum.filter(&(elem(&1, 0) == "Link"))
    |> Enum.map(&(ExLinkHeader.parse!(elem(&1, 1))))
    |> Enum.filter(&!is_nil(&1.next))
  end

  defp get_url_params(url) do
    case URI.parse(url).query do
      nil -> []
      qry -> URI.query_decoder(qry) |> Enum.to_list()
    end
  end

  @token_exp 60
