              :no-update
              (open-domain local-config
                           (str (path local-dir domain))
-                          (domain/host-shards (domains-info domain)))))))))
+                          host-shards)))))))
 
 (defn purge-unused-domains!
   "Walks through the supplied local directory, recursively deleting
   all directories with names that aren't present in the supplied
-  `domain-set`."
-  [domain-set local-dir]
-  (let [lfs (local-filesystem)]
+  `domains`."
+  [domain-seq local-dir]
+  (let [lfs (local-filesystem)
+        domain-set (set domain-seq)]
     (dofor [domain-path (-> local-dir mk-local-path .listFiles)
             :when (and (.isDirectory domain-path)
-                       (not (contains? domain-set (.getName domain-path))))]
+                       (not (contains? domain-set
+                                       (.getName domain-path))))]
            (log-message "Deleting local path of deleted domain: " domain-path)
            (delete lfs (.getPath domain-path) true))))
 


;; TODO: examine this... can we remove this use-cache deal?
(defn use-cache-or-update
  ([domain domains-info global-config local-config]
     (->> {domain (domain/host-shards (domains-info domain))}
          (mk-loader-state)
          (use-cache-or-update domain domains-info global-config local-config false)))
  ([domain domains-info global-config local-config update? ^DownloadState state]
     (let [fs (filesystem (:hdfs-conf local-config))
           lfs (local-filesystem)
           local-dir (:local-dir local-config)

                      local-config
                      local-domain-root
                      remote-path
                      host-shards
                      state)
         ;; use cached domain from local-dir (no update needed)
         (do
