 
   defp load_from_environment() do
     %{}
-    |> load_environment(@string_keys, &(&1))
-    |> load_environment(@bool_keys, &(true?(&1)))
-    |> load_environment(@atom_keys, &(String.to_atom(&1)))
-    |> load_environment(@string_list_keys, &(String.split(&1, ",")))
+    |> load_environment(@string_keys, & &1)
+    |> load_environment(@bool_keys, &true?(&1))
+    |> load_environment(@atom_keys, &String.to_atom(&1))
+    |> load_environment(@string_list_keys, &String.split(&1, ","))
   end
 
   defp coerce_map(value) when is_list(value) do
     value |> Enum.into(%{})
   end
+
   defp coerce_map(%{} = value) do
     value
   end

  defp true?(true), do: true
  defp true?(_), do: false

  @language_integration_version Mix.Project.config[:version]

  @doc """
  Write the currently known AppSignal configuration to the system environment.

    app_config = Application.get_env(:appsignal, :config, []) |> coerce_map
    env_config = load_from_environment()

    config =
      @default_config
      |> Map.merge(system_config)
      |> Map.merge(app_config)
      |> Map.merge(env_config)

    # Config is valid when we have a push api key
    config =
      config
      |> Map.put(:valid, !empty?(config[:push_api_key]))

    Application.put_env(:appsignal, :config, config)

    case config[:valid] do
      true ->
        :ok

      false ->
        {:error, :invalid_config}
    end
