   "Loads all documents from database to the cache. Use with care.
    Returns nil."
   []
-  (doseq [get-doc-fn [get-working-doc get-default-doc], id (get-doc-ids), lang (get-langs)]
-    (get-doc-fn id lang)))
+  (doseq [doc-fn [working-doc default-doc], id (doc-ids), lang (langs)]
+    (doc-fn id lang)))
 
 
 (defn unload-docs
   "Unloads doc(s) with the given id(s) from the cache.
    Returns nil."
   [id & ids]
-  (let [cache (get-doc-cache)]
+  (let [cache (doc-cache)]
     (doseq [doc-id (cons id ids)] (.removeDocumentFromCache cache doc-id))))
 
 
 (defn clear-cache []
-  (.clearCache (get-doc-cache)))
+  (.clearCache (doc-cache)))
 
 
 (defn loaded-docs-info

  (:import
    [imcode.server Imcms]
    [imcode.server.document DocumentDomainObject]
    [com.imcode.imcms.misc-utils :only (dump)]    
    [imcode.server.user UserDomainObject]))

(defmacro invoke
  "Invokes Imcms class static method."



(defn find-lang-by-code [#^String code]
  (if-let [lang (.getByCode (i18n-support) code)]
    lang
    (throw (Exception. (format "Language with code [%s] can not be found." code)))))

