         zcbClient          (ZeroClipboard. $copy-to-clipboard)
         $urlShortenerInput ($ :#url-shortener)]
     (.click $urlShortenerInput
-            (fn []
-              (let [currentUrl      (aget js/document "URL")
-                    localStorageKey (str "shortUrl-" currentUrl)
-
-                    mbShortUrl
-                    (and localStorage
-                         (.getItem localStorage localStorageKey))]
-                (if mbShortUrl
-                    (.val $urlShortenerInput mbShortUrl)
-                    (get-short-url $urlShortenerInput localStorage)))))))
+            (get-short-url-jq-evt-handler-maker $urlShortenerInput
+                                                localStorage))))
 
 ; Main entry point of the program
 (defn ^:export init [acad-year sem]

                     (.val $urlShortenerInput
                           "an error occurred"))}))

(defn- short-url-setup
  "Setup url shortening"
  []

        (initialize-exhibit3 (aget js/window "MODULES")
                             (aget js/window "AUXMODULES")))))

(defn- make-request-to-get-short-url
  "Makes the ajax request to the server to obtain a short url"
  [currentUrl $urlShortenerInput localStorage localStorageKey]
  (ajax "/shorten"
        {:data     {:url (js/encodeURI currentUrl)}
         :dataType "json"

         :success
