   defp map(%{__struct__: _} = struct, _fun, _id), do: struct
 
   defp map(map, fun, id) when is_map(map),
-    do:
-      map
-      |> Map.to_list()
-      |> Enum.into(%{}, fn {k, v} -> {k, map(v, fun, id)} end)
+    do: Enum.into(map, %{}, fn {k, v} -> {k, map(v, fun, id)} end)
 
   defp map(list, fun, id) when is_list(list),
-    do:
-      list
-      |> Enum.map(fn v -> map(v, fun, id) end)
+    do: Enum.map(list, fn v -> map(v, fun, id) end)
 
   defp map(value, _fun, _id), do: value
 end

        )
      end

      def new(data),
        do:
          data
          |> init()
          |> new()

      @doc """
      Returns true if the `value` is a valid value against the given `schema`;
      otherwise returns false.

      ## Examples


      def valid?(schema, value), do: validate(schema, value) == :ok

      @doc """
      Returns `true` if the `value` is a valid value against the given `schema`;
      otherwise returns `false`.
      """
      @deprecated "Use valid? instead"
      @spec is_valid?(__MODULE__.t(), any) :: boolean
