   end
 
   @doc false
-  @spec end_session(Session.t(), [end_session_opts]) :: :ok
-  def end_session(session, opts \\ []) do
-    end_session_fn = Keyword.get(opts, :end_session_fn, &WebdriverClient.delete_session/1)
-
-    end_session_fn.(session)
+  @spec end_session(Session.t()) :: :ok
+  def end_session(session) do
+    WebdriverClient.delete_session(session)
     :ok
   end
 

  @spec start_session([start_session_opts]) :: Wallaby.Driver.on_start_session() | no_return
  def start_session(opts \\ []) do
    base_url = Keyword.get(opts, :remote_url, "http://localhost:4444/wd/hub/")
    create_session_fn = Keyword.get(opts, :create_session_fn, &WebdriverClient.create_session/2)

    capabilities = Keyword.get(opts, :capabilities, capabilities_from_config())

    with {:ok, response} <- create_session_fn.(base_url, capabilities) do
      id = response["sessionId"]

      session = %Wallaby.Session{

  ```elixir
  Wallaby.start_session(
    remote_url: "http://selenium_url",
    capabilities: %{browserName: "firefox"}
  )
  ```
  """
  @type start_session_opts ::
          {:remote_url, String.t()}
          | {:capabilities, map}

  @doc false
  def start_link(opts \\ []) do
