   end
 
   defp parse_errors(<<1, rest :: binary>>, acc) do
-    case GP.parse(rest, List.duplicate(&parse(&1, :string), 2)) do
-      {[class, message], rest} ->
-        parse_errors(rest, [{class, message}|acc])
-      :incomplete ->
-        :incomplete
+    case GP.parse(rest, [&parse(&1, :string), &parse(&1, :string)]) do
+      {[class, message], rest} -> parse_errors(rest, [{class, message}|acc])
+      :incomplete              -> :incomplete
     end
   end
 

    end
  end

  def parse_header(@ok <> <<sid :: int, rest :: binary>>) do
    {:ok, sid, rest}
  end

  def parse_header(@error <> <<_sid :: int, rest :: binary>>) do
    {:error, rest}
  end

  def parse_header(_) do
    :incomplete
  end

  def parse(<<-1 :: int, rest :: binary>>, type) when type in [:string, :bytes] do
    {nil, rest}

    ]

    case GP.parse(data, parsers) do
      {[sid, token, _clusters, _config, _release], rest} -> {[sid, token], rest}
      :incomplete                                        -> :incomplete
    end
  end

