                   "Start"]]]]]
              [:.col-sm-6
               [:form.form-horizontal
-               [:.form-group
-                [:.col-sm-12
-                 [:label.checkbox
-                  [:input.custom-checkbox
-                   {:type      "checkbox"
-                    :checked   (when (:remove-edges? settings) "checked")
-                    :on-change #(om/update! settings :remove-edges? (.. % -target -checked))}]
-                  [:span.icons
-                   [:span.icon-checked]
-                   [:span.icon-unchecked]]
-                  "Remove edges?"]]]
-               [:.form-group
-                [:.col-sm-12
-                 [:label.checkbox
-                  [:input.custom-checkbox
-                   {:type      "checkbox"
-                    :checked   (when (:remove-nodes? settings) "checked")
-                    :on-change #(om/update! settings :remove-nodes? (.. % -target -checked))}]
-                  [:span.icons
-                   [:span.icon-checked]
-                   [:span.icon-unchecked]]
-                  "Remove nodes?"]]]]]]]])))))
+               (checkbox settings [:remove-edges?] "Remove edges?")
+               (checkbox settings [:remove-nodes?] "Remove nodes?")]]]]])))))
 
 (defmulti mutation-view :operation)
 

                                                    :momentum (js/parseFloat (:momentum settings))
                                                    :iter-count (js/parseInt (:iter-count settings))
                                                    :remove-edges? (:remove-edges? settings)
                                                    :remove-nodes? (:remove-nodes settings)))
               (recur))
      (go-loop [frame (<! connection)]
               (if-not (nil? frame)

                    :remove-nodes? false}
         :solvings []}))

(defn- checkbox
  "Simple checkbox which binds its value to path in cursor"
  [cursor path label-text]
  {:pre [(om/cursor? cursor)
         (coll? path)
         (string? label-text)]}
  [:.form-group
   [:.col-sm-12
    [:label.checkbox
     [:input.custom-checkbox
      {:type      "checkbox"
       :checked   (when (get-in cursor path) "checked")
       :on-change #(om/update! cursor path (.. % -target -checked))}]
     [:span.icons
      [:span.icon-checked]
      [:span.icon-unchecked]]
     label-text]]])

(defn- text-input
  "Simple text input which binds its value to path in cursor"
  [cursor path label-text label-params input-params]
  {:pre [(om/cursor? cursor)
         (coll? path)
         (string? label-text)
         (map? label-params) (map? input-params)]}
  [:.form-group
   [:label.control-label label-params label-text]
   [:div input-params
    [:input.form-control
     {:value (get-in cursor path)
      :on-change #(om/update! cursor path (.. % -target -value))}]]])

(defn settings-panel [{:keys [start-chan running? settings]} owner]
  (reify
    om/IRender
    (render [_]
      (let [[label-width field-width] [6 6]
            label-params {:class (str "col-sm-" label-width)}
            input-params {:class (str "col-sm-" field-width)}]
        (html
          [:.panel.panel-default.settings
           [:.panel-heading "Settings"]
