         sync! (fn [new-registry]
                 (let [required? (calc-deps graph (keys new-registry))
                       ordered   (filter required? (dep/topo-sort graph))
-                      new-ders  (sync-derivatives spec (:derivatives @state) ordered)]
-                  (swap! state assoc :derivatives new-ders, :registry new-registry)
-                  new-ders))]
-    {:get! (fn get! [der-k token]
+                      new-drvs  (sync-derivatives spec (:derivatives @state) ordered)]
+                  (swap! state assoc :derivatives new-drvs, :registry new-registry)
+                  new-drvs))]
+    {:get! (fn get! [drv-k token]
              (let [registry  (:registry @state)
-                   new-reg   (update registry der-k (fnil conj #{}) token)]
-               (if-let [derivative (get (sync! new-reg) der-k)]
+                   new-reg   (update registry drv-k (fnil conj #{}) token)]
+               (if-let [derivative (get (sync! new-reg) drv-k)]
                  derivative
-                 (throw (ex-info (str "No derivative defined for " der-k) {:key der-k})))))
-     :release! (fn release! [der-k token]
+                 (throw (ex-info (str "No derivative defined for " drv-k) {:key drv-k})))))
+     :release! (fn release! [drv-k token]
               (let [registry  (:registry @state)
-                    new-reg   (if (= #{token} (get registry der-k))
-                                (dissoc registry der-k)
-                                (update registry der-k disj token))]
+                    new-reg   (if (= #{token} (get registry drv-k))
+                                (dissoc registry drv-k)
+                                (update registry drv-k disj token))]
                 (sync! new-reg)
                 nil))}))
 

                    (prn :creating-new-ref k)
                    (assoc m k (rum/derived-atom (map #(get m %) direct-deps) k derive)))
                  (assoc m k derive)))))
          (select-keys der-map order) 
          order))

(defn derivatives-manager

  (apply s/union (set ks) (map #(dep/transitive-dependencies graph %) ks)))

(defn sync-derivatives
  "Update the derivatives map `drv-map` so that all keys passed in `order`
   are statisfied and any superfluous keys are removed"
  [spec drv-map order]
  (reduce (fn [m k]
            (let [[direct-deps derive] (-> spec k)]
              (if (get m k)
