   end
 
   defp load_asciicast(conn, _) do
-    asciicast = Asciicasts.get_asciicast!(conn.params["id"])
-
-    if asciicast.archived_at do
-      case get_format(conn) do
-        "html" ->
-          conn
-          |> put_status(410)
-          |> render("archived.html")
-          |> halt()
-
-         _ ->
-          conn
-          |> send_resp(410, "")
-          |> halt()
-      end
-    else
-      assign(conn, :asciicast, asciicast)
-    end
+    assign(conn, :asciicast, Asciicasts.get_asciicast!(conn.params["id"]))
   end
 
   defp count_view(conn, asciicast) do

    end
  end

  def iframe(conn, %{"id" => id}) do
    asciicast = Asciicasts.get_asciicast!(id)

    conn
    |> put_layout("iframe.html")
    |> delete_resp_header("x-frame-options")
    |> render("iframe.html", file_url: asciicast_file_url(conn, asciicast))
  end

  def embed(conn, %{"id" => id} = params) do
    asciicast = Asciicasts.get_asciicast!(id)
    opts = Asciicasts.PlaybackOpts.parse(params)

    conn
    |> put_layout("embed.html")
    |> delete_resp_header("x-frame-options")
    |> render("embed.html",
      asciicast: asciicast,
      playback_options: opts
    )
  end

  def example(conn, _params) do


    conn
    |> put_layout("example.html")
    |> render_asciicast("example.html", home_asciicast: home_asciicast)
  end

  defp render_asciicast(conn, template, assigns) do
    if conn.assigns.asciicast.archived_at do
      render_archived(conn)
    else
      render(conn, template, assigns)
    end
  end

  defp render_archived(conn) do
    case get_format(conn) do
      "html" ->
        conn
        |> put_status(410)
        |> render("archived.html")

      _ ->
        send_resp(conn, 410, "")
    end
  end

  defp download_filename(%Asciicast{version: version, id: id}, %{"dl" => _}) do
