     end
   end
 
-  defp encode_values(values) when values == [] or map_size(values) == 0 do
+  defp encode_query_values(values) when values == [] or map_size(values) == 0 do
     <<>>
   end
 
-  defp encode_values(values) when is_list(values) do
+  defp encode_query_values(values) when is_list(values) do
     for value <- values, into: <<length(values)::16>> do
-      value = encode_query_value(value)
-      <<byte_size(value)::32>> <> value
-    end
-  end
-
-  defp encode_values(values) when is_map(values) do
+      encode_query_value(value)
+    end
+  end
+
+  defp encode_query_values(values) when is_map(values) do
     for {name, value} <- values, into: <<map_size(values)::16>> do
       name = to_string(name)
-      value = encode_query_value(value)
       <<byte_size(name)::16>> <> name <>
-        <<byte_size(value)::32>> <> value
+        encode_query_value(value)
     end
   end
 


    encode_consistency_level(consistency) <>
      <<flags>> <>
      encode_values(values) <>
      <<page_size::32>> <>
      encode_paging_state(paging_state)
  end

    do: 1 + varint_byte_size(value >>> 8)
  defp varint_byte_size(value) when value < -128,
    do: varint_byte_size(-value - 1)

  @compile {:inline, decode_base16: 1}
  defp decode_base16(value) do
