     ;; load a file into all the appropriate envs
     (when-let [js-content (try (slurp url) (catch Throwable t))]
       (evaluate this js-content)))
-  (-tear-down [{:keys [server-kill printing-listener]}]
-    (when-let [kill-fn @server-kill]
-      (reset! server-kill nil)
-      (kill-fn))
+  (-tear-down [{:keys [server printing-listener]}]
+    (when-let [svr @server]
+      (reset! server nil)
+      (.stop svr))
     (when-let [listener @printing-listener]
       (remove-listener listener)))
   cljs.repl/IReplEnvOptions

                       port default-port} :as opts}]
  (merge (FigwheelReplEnv.)
         ;; TODO move to one atom
         {:server-kill (atom nil)
          :printing-listener (atom nil)
          :bound-printer (atom nil)
          :open-url open-url

  (when (and
         (or (not (bound? #'*server*))
             (nil? *server*))
         (nil? @(:server repl-env)))
    (let [server (run-default-server
                  (merge (select-keys repl-env [:port
                                                :host
