 
 (defmethod process-command! [(command-names :replace-catalog) 2]
   [{:keys [version] :as  command} options]
-  (log/warn "command 'replace catalog' version 2 is deprecated, use the latest version")
+  (warn-deprecated version "replace catalog")
   (replace-catalog* command options))
 
 (defmethod process-command! [(command-names :replace-catalog) 3]
   [{:keys [version] :as  command} options]
-  (log/warn "command 'replace catalog' version 2 is deprecated, use the latest version")
+  (warn-deprecated version "replace catalog")
   (replace-catalog* command options))
 
 (defmethod process-command! [(command-names :replace-catalog) 4]

;; Fact replacement

(defmethod process-command! [(command-names :replace-facts) 1]
  [command config]
  (-> command
      (assoc :version 2)
      (update-in [:payload] #(upon-error-throw-fatality (json/parse-string %)))

        (scf-storage/replace-catalog! catalog timestamp catalog-hash-debug-dir)))
    (log/info (format "[%s] [%s] %s" id (command-names :replace-catalog) certname))))

(defn warn-deprecated
  "Logs a deprecation warning message for the given `command` and `version`"
  [version command]
  (log/warn (format "command '%s' version %s is deprecated, use the latest version" command version)))

(defmethod process-command! [(command-names :replace-catalog) 1]
  [{:keys [version payload] :as command} options]
  (warn-deprecated version "replace catalog")
  (when-not (string? payload)
    (throw (IllegalArgumentException.
             (format "Payload for a '%s' v1 command must be a JSON string."
