   @spec wrap(String.t(), String.t(), String.t()) :: String.t()
   defp wrap(str, trailing, pending), do: "#{trailing}#{str}#{pending}"
 
-  @spec to_tuple(Xema.Schema.t(), keyword) :: tuple
-  defp to_tuple(%Xema.Schema{} = schema, keywords) do
+  @spec to_tuple(Xema.Schema.t()) :: tuple
+  defp to_tuple(%Xema.Schema{} = schema) do
     schema
     |> Map.from_struct()
     |> delete_as()
     |> delete_nils()
     |> extract_type()
-    |> merge(keywords)
   end
 
   @spec delete_as(map) :: map


  def to_string(%Xema.Schema{} = schema, opts) do
    format = Keyword.get(opts, :format, :data)
    keywords = Keyword.get(opts, :keywords, [])
    root = Keyword.get(opts, :root, true)
    tuple = to_tuple(schema, keywords)

    do_to_string(format, tuple, root)
  end

  @spec extract_type(map) :: {atom, keyword}
  defp extract_type(%{type: type} = schema),
    do: {type, schema |> Map.delete(:type) |> Map.to_list()}
end
