             (apply-gear-attrs! (gear-map key-) attrs))
           (js/Gear.updateGears gear-array)
           (<! (timeout dt)))
-
-        ;; only continue if this is still the active timer
-        (when (= index @reload-index)
+        (when (should-continue?)
           (recur)))
 
       (js/d3.timer
         (fn []
           (tick-svg! svg)
-
-          ;; only continue if this is still the active timer
-          (not= index @reload-index))))))
+          (not (should-continue?)))))))
 
 (defn create-gears!
   [selector

    (doseq [g gear-objs]
      (.push gear-array g))

    (animate-gears! svg gear-map gear-array anim-frames)))


      (.attr gear-obj (name k) v))))

(defonce reload-indexes (atom {}))

(defn animate-gears!
  [svg selector gear-map gear-array anim-frames]

  (let [update-index #(inc (or % 0))
        _ (swap! reload-indexes update selector update-index)
        latest-index #(get @reload-indexes selector)
        index (latest-index)
        should-continue? #(= index (latest-index))]

    (when (seq anim-frames)
      (go-loop []
