   (let [k (key-event->keycode e)]
     (when (legal-key k) 
       (condp = k
-        ENTER (do 
-                (when (not (empty? (:text state)))
-                  (set! js/window.location.hash ((-> @data :routes :search) 
-                                                 {:query (:text state)}))
-                  (om/set-state! owner :text "")))
+        ENTER (maybe-search data state owner)
         ESC   (om/set-state! owner :text "")))))
 
 ; render ---

                      (dom/button
                        #js {:onClick (fn [e]
                                        (.preventDefault e)
                                        (set! js/window.location.hash ((-> @data :routes :index)))
                                        )}
                        "Reset")
                      ; loading

               (dom/button 
                 #js {:onClick (fn [e]
                                 (.preventDefault e)
                                 (maybe-search data state owner)
                                 )}
                 "Search")
               ; clear button
