 
 (defn difficulty-picker
   []
-  (let [id [:options :difficulty]
-        click-fn (fn [e]
-                   (swap! app-state
-                          #(assoc-in % id (keyword (.. e -target -dataset -key)))))
-        btn-class-fn (partial join-by-space "btn" "btn-default")
-        options [[:easy :home.difficulty/easy]
-                 [:normal :home.difficulty/normal]
-                 [:hard :home.difficulty/hard]]
-        button-fn (fn [current-id [id translate-id]]
-                    [:button {:class (btn-class-fn (when (= id current-id) "active"))
-                              :data-key id
-                              :key id} 
-                     (t translate-id)])]
-    (fn []
-      (let [difficulty (get-in @app-state id)]
-        [:div.form-group {:on-click click-fn}
-         [:label.col-sm-4.control-label (t :home.difficulty/label)]
-         [:div.btn-group.col-sm-8 {:role "group"}
-          (doall (for [option options]
-                   (button-fn difficulty option)))]]))))
+  (single-select [:options :difficulty]
+                 :home.difficulty/label
+                 [[:easy :home.difficulty/easy]
+                  [:normal :home.difficulty/normal]
+                  [:hard :home.difficulty/hard]]))
 
 (defn selector-picker
   []
-  (let [active-selectors (get-in @app-state [:options :selectors])
-        selectors [[:persons (t :home.domains/persons)]
-                   [:places (t :home.domains/places)]
-                   [:works (t :home.domains/works)]
-                   [:born-in-brno (t :home.domains/born-in-brno)]
-                   [:ksc-members (t :home.domains/ksc-members)]
-                   [:uncertain-death (t :home.domains/uncertain-death)]
-                   [:artists (t :home.domains/artists)]
-                   [:politicians (t :home.domains/politicians)]
-                   [:musicians (t :home.domains/musicians)]
-                   [:films (t :home.domains/films)]]]
-        [:div.form-group
-         [label-element "options.selectors" (t :home.domains/label)]
-         [:div.col-sm-8.btn-group-vertical {:role "group"}
-          (for [[id label] selectors
-                :let [active? (active-selectors id)
-                      update-fn (if active? disj conj)]]
-            [:button {:class (join-by-space "btn" "btn-default" (when active? "active"))
-                      :key label
-                      :on-click (fn [_] (swap! app-state
-                                               (fn [state] (update-in state
-                                                                      [:options :selectors]
-                                                                      #(update-fn % id)))))}
-             label])]]))
+  (multi-select [:options :selectors]
+                :home.domains/label
+                [[:persons :home.domains/persons]
+                 [:places :home.domains/places]
+                 [:works :home.domains/works]
+                 [:born-in-brno :home.domains/born-in-brno]
+                 [:ksc-members :home.domains/ksc-members]
+                 [:uncertain-death :home.domains/uncertain-death]
+                 [:artists :home.domains/artists]
+                 [:politicians :home.domains/politicians]
+                 [:musicians :home.domains/musicians]
+                 [:films :home.domains/films]]))
 
 (defn google-spreadsheet-options
   []

; ----- Common components -----

(defn menu
  []
  [:div#info-menu.btn-group {:role "group"}
   [:a.btn.btn-default {:href "#"}
    [:span.glyphicon.glyphicon-home.glyphicon-start]
    (t :labels/home)]
   [:button.btn.btn-default {:on-click #(reagent-modals/modal! (modals/game-info)
                                                               {:size :lg})}
    [:span.glyphicon.glyphicon-info-sign.glyphicon-start]
    (t :labels/about)]])

(defn label-element
  "Label with text for input identified with for-id"
  [for-id text]
  [:label.col-sm-4.control-label {:for for-id} text])

; ----- Home page -----


  []
  (let [{:keys [board current-field]} @app-state]
    (if (empty? board)
      (do (redirect "#") ; If no data is loaded, redirect to home page.
          [:div]) ; Return empty div as a valid Reagent component. 
      [:div.container-fluid
       [menu]
       [:div.row
