 (reg-event-db
   :auth-request
   (fn [app-state [_ signup?]]
-    (let [url       (if signup? "signup" "login")
-          ;; Should probalby centralize password validation, so we can use the same function
+    (let [url    (if signup? "signup" "login")
+          ;; Should probably centralize password validation, so we can use the same function
           ;; both here and when the UI is being updated
-          is-valid? (or (not signup?)
-                        (= (get-in app-state [:credentials :password])
-                           (get-in app-state [:credentials :password2])))]
-      (if is-valid?
+          valid? (or (not signup?)
+                     (= (get-in app-state [:credentials :password])
+                        (get-in app-state [:credentials :password2])))]
+      (if valid?
         (POST (str "/api/auth/" url) {:params        (:credentials app-state)
                                       :handler       #(dispatch [:auth-set-token (:token %)])
                                       :error-handler #(dispatch [:auth-request-error %])}))

(reg-event-db
  :state-ui-section
  (fn [app-state [_ section]]
    (if (= :remember section)
      (dispatch [:memories-load]))
    ; Do not associate nil sections


(defn set-page! [match]
  (let [{:keys [handler route-params]} match]
    (trace "Setting" match)
    (if (fn? handler)
      (handler route-params)
      (dispatch [:state-ui-section handler]))))

(defn bidi-matcher [s]
  (trace "Matching" s (bidi/match-route routes s))
  (bidi/match-route routes s))

(def history
