 
   # Private helpers
 
-  def add_performance_breadcrumb(conn, %Contest{} = contest, %Performance{} = performance) do
-    add_breadcrumb(conn,
-      name: performance.edit_code,
-      path: internal_contest_performance_path(conn, :show, contest, performance)
-    )
+  defp add_breadcrumbs(conn, %Contest{} = c) do
+    conn
+    |> add_contest_breadcrumb(c)
+    |> add_performances_breadcrumb(c)
+  end
+
+  defp add_breadcrumbs(conn, %Contest{} = c, %Performance{} = p) do
+    performance_path = internal_contest_performance_path(conn, :show, c, p)
+
+    conn
+    |> add_breadcrumbs(c)
+    |> add_breadcrumb(name: p.edit_code, path: performance_path)
   end
 end

    conn
    |> assign(:contest, contest)
    |> assign(:performances, performances)
    |> add_contest_breadcrumb(contest)
    |> add_performances_breadcrumb(contest)
    |> render("index.html")
  end


    conn
    |> assign(:contest, contest)
    |> assign(:performance, performance)
    |> add_breadcrumbs(contest, performance)
    |> render("show.html")
  end

