     @build_has_been_loaded(false)
     project_name = "#{username}/#{project}"
     @maybeLoadProjectDetails(project_name)
-    @build().clean() if @build()
-    @build(null)
+    @cleanBuild()
     $.getJSON "/api/v1/project/#{project_name}/#{build_num}", (data) =>
       @build(new CI.inner.Build data)
       @build_has_been_loaded(true)

window.SammyApp = Sammy 'body', (n) ->
  @bind 'run-route', (e, data) ->
    VM.clearErrorMessage()
    mixpanel.track_pageview(data.path)
    if window._gaq? # we dont use ga in test mode
      window._gaq.push data.path

          "&filters%5B0%5D%5Bcomparison%5D=contains&filters%5B0%5D%5Bvalue%5D=" +
          path[1]

  cleanBuild: () =>
    if @build() then @build().clean()
    @build(null)

  refreshBuildState: () =>
    VM.loadProjects()
    VM.current_page().refresh()
