 
 (defn clear-all
   "Clears the entire cache. Does not respect namespaces!"
-  [& {:keys [service namespace]}]
-  (let [service (get-memcache-service :service service :namespace namespace)]
-    (.clearAll service)))
+  []
+  (.clearAll (get-memcache-service)))
 
 
-(defn contains? [key & {:keys [service namespace]}]
-  (let [service (get-memcache-service :service service :namespace namespace)]
-    (.contains service key)))
+(defn contains? [key & {:keys [namespace]}]
+  (.contains (get-memcache-service :namespace namespace) key))
 
 
 (defn delete
   "If (sequential? key), deletes in batch."
-  [key & {:keys [service namespace millis-no-readd]}]
-  (let [service (get-memcache-service :service service :namespace namespace)]
+  [key & {:keys [namespace millis-no-readd]}]
+  (let [service (get-memcache-service :namespace namespace)]
     (if millis-no-readd
         (if (sequential? key)
             (.deletAll service key millis-no-readd)


(defn get
  "If (sequential? key), returns values as a map."
  [key & {:keys [service namespace]}]
  (let [service (get-memcache-service :service service :namespace namespace)]
    (if (sequential? key)
        (into {} (.getAll service key))
        (.get service key))))


(defn put [key value & {:keys [service namespace expiration policy]
                        :or {policy :always}}]
  (let [service (get-memcache-service :service service :namespace namespace)
        policy (*policy-type-map* policy)]
    (.put service key value expiration policy)))


(defn put-map [values & {:keys [service namespace expiration policy]
                         :or {policy :always}}]
  (let [service (get-memcache-service :service service :namespace namespace)
        policy (*policy-type-map* policy)]
    (.putAll service values expiration policy)))


(defn increment
  "If (sequential? key), increment each key by the delta."
  [key delta & {:keys [service namespace initial]}]
  (let [service (get-memcache-service :service service :namespace namespace)]
    (if initial
        (if (sequential? key)
            (.incrementAll service key delta (long initial))

            (.increment service key delta)))))


(defn increment-map [values & {:keys [namespace initial]}]
  (let [service (get-memcache-service :namespace namespace)]
    (if initial
        (.incrementAll service values (long initial))
        (.incrementAll service values))))
