   end
 
   defp items_tuple([], _additonal_items, [], _at), do: :ok
-  defp items_tuple(_schemas, _additonal_items, [], at),
-    do: error :missing_item, at: at
-  defp items_tuple([], false, _list, at),
-    do: error :additional_item, at: at
+  defp items_tuple(_schemas, _additonal_items, [], at) do
+    error :missing_item, at: at
+  end
+  defp items_tuple([], false, _list, at), do: error :additional_item, at: at
   defp items_tuple([], true, _list, _at), do: :ok
   defp items_tuple([schema|schemas], additional_items, [item|list], at) do
     case Xema.validate(schema, item) do


  defp keys(%Xema.Map{keys: nil}, _value), do: :ok
  defp keys(%Xema.Map{keys: :atom}, map) do
    if map |> Map.keys |> Enum.all?(&is_atom/1),
      do: :ok,
      else: {:error, %{reason: :invalid_keys, keys: :atom}}
  end
  defp keys(%Xema.Map{keys: :string}, map) do
    if map |> Map.keys |> Enum.all?(&is_binary/1),
      do: :ok,
      else: {:error, %{reason: :invalid_keys, keys: :string}}
  end

  defp properties(%Xema.Map{properties: nil}, map), do: {:ok, map}

  end

  defp items(%Xema.List{items: nil}, _list), do: :ok
  defp items(
    %Xema.List{items: items, additional_items: additional_items},
    list
  ) when is_list(items), do: items_tuple(items, additional_items, list, 0)
  defp items(%Xema.List{items: items}, list), do: items_list(items, list, 0)

  defp items_list(_schema, [], _at), do: :ok
  defp items_list(schema, [item|list], at) do
