       (do
         (alter-var-root #'system
           (constantly ((components/init mode))))
-        (alter-var-root #'state (fn [_] :initialized))))
-    state))
+        (:system (set-state! :system :initialized))))))
 
 (defn deinit
   []

;;;   State & Transition Vars   ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(def ^:dynamic state :stopped)
(def ^:dynamic system nil)
(def valid-stop-transitions #{:started :running})
(def invalid-init-transitions #{:initialized :started :running})

      (log/warn "System has already been started.")
      (do
        (alter-var-root #'system component/start)
        (:system (set-state! :system :started))))))

(defn stop
  []
