    :keywords? true))
 
 (defn add-hyphenation-pattern!
-  [pattern]
+  [pattern on-success on-error]
   (ajax/POST "/api/words"
    :params pattern
-   :handler (fn []
-              (set-feedback! "Word has been added" :success)
-              (load-hyphenation-patterns! @spelling @word))
-   :error-handler (fn [details]
-                    (.warn js/console
-                           (str "Failed to add hyphenation pattern: " details)))
+   :handler on-success
+   :error-handler on-error
    :format :json))
 
 (defn remove-hyphenation-pattern!

                           (hyphenation-valid? @hyphenation @word)
                           (not (contains? @hyphenations @word))
                           (not= @hyphenation @suggested-hyphenation))
                  (add-hyphenation-pattern! {:word @word :hyphenation @hyphenation :spelling @spelling}))
     :disabled (when (or (string/blank? @word)
                         (not (hyphenation-valid? @hyphenation @word))
                         (contains? @hyphenations @word)

                        @spelling word
                        (fn [hyphenation] (reset! new-suggestion hyphenation))))
            save #(do (when (hyphenation-valid? @new-hyphenation word)
                        (let [pattern (assoc pattern :hyphenation @new-hyphenation)
                              on-success (fn [] (swap! app-state assoc-in [:hyphenations word] pattern))
                              on-error (fn [details]
                                         (.warn js/console
                                          (str "Failed to update hyphenation pattern: " details)))]
                          (add-hyphenation-pattern! pattern on-success on-error)))
                      (reset! editing false))
            remove #(remove-hyphenation-pattern! pattern)]
        (if-not @editing
