     IDisplayName
     (display-name [_]
       "The timer")
-    IInitState
-    (init-state [_]
-      {:width 500
-       :height 500
-       :radius 200
-       :x 250
-       :y 250})
-    IRenderState
-    (render-state [_ {w :width h :height x :x y :y r :radius}]
-      (let [start-date (time-coerce/to-date (get-in data [:timer :Start]))
-            timer-dim {:x x :y y :r r :start start-date}]
+    IRender
+    (render [_]
+      (let [cursors (select-keys data [:dimensions :timer])
+            {w :width h :height x :x y :y r :r} (:dimensions cursors)]
         (dom/svg #js {:width w
                       :height h}
                  (circle x y (+ r 20) "green")
                  (circle x y r "white")
-                 (om/build timer-minutes nil {:init-state timer-dim})
-                 (om/build timer-hours nil {:init-state timer-dim})
-                 (om/build timer-seconds nil {:init-state timer-dim})
-                 (om/build timer-text nil {:init-state timer-dim}))))))
+                 (om/build timer-minutes cursors)
+                 (om/build timer-hours cursors)
+                 (om/build timer-seconds cursors)
+                 (om/build timer-text cursors))))))
 
 (defn menu-view [data owner]
   (reify

        (recur)))
    IInitState
    (init-state [_]
      {:elapsed-seconds 0})
    IRenderState
    (render-state [_ {x :x y :y r :r sec :elapsed-seconds}]
      (dom/line #js {:x1 (+ x (math/angleDx (* 6 sec) (/ r 1.4)))
                     :y1 (+ y (math/angleDy (* 6 sec) (/ r 1.4)))
                     :x2 (+ x (math/angleDx (* 6 sec) r))
                     :y2 (+ y (math/angleDy (* 6 sec) r))
                     :style #js {:stroke "#bfbfbf"
                                 :strokeWidth "4px"}
                     :transform (str "rotate(-90," x "," y")")}))))

(defn timer-text [data owner]
  (reify

    (init-state [_]
      {:elapsed-minutes 0})
    IRenderState
    (render-state [owner {min :elapsed-minutes}]
      (let [{x :x y :y r :r} (:dimensions data)]
        (pie x y r "#d9d9d9" (* 6 10 min))))))

(defn timer-hours [data owner]
  (reify
    IDisplayName
    (display-name [_]
      "Hours on the timer")
    IWillMount
    (will-mount [_]
      (go-loop []
        (let [start (time-coerce/to-date (get-in data [:timer :Start]))
              interval-seconds (/ (time/in-millis (time/interval start (time/now))) 1000)]
          (om/update-state! owner :elapsed-hours #(mod (/ interval-seconds 60 60) 24)))
        (<! (async/timeout 10000))
