                 (assoc % mkey pkeys))))
     (get @mkeys mkey)))
 
-(defn set-keys!
+(defn- set-keys!
   [mkeys tenant period rollup time path ttl fn-get fn-agg fn-store fn-key]
   (let [pkeys (set-pkeys! mkeys tenant period rollup time ttl fn-get
                           fn-agg fn-store fn-key)]
     (swap! pkeys #(if (contains? % path) % (conj % path)))
     pkeys))
 
-(defn run-flusher!
+(defn- run-flusher!
   [mkeys]
   (debug "Flushing the cache...")
   (doseq [[mkey pkeys] @mkeys]

      (catch Exception e
        (info e "Cache flushing exception")))))

(defn run-delayer!
  [rollup fn-flusher]
  (let [delayer (future
                  (Thread/sleep (to-ms (calc-delay rollup (rand-int 59)))))

          (deref flusher)))))
  (debug "The cache has been flushed"))

(defn- store-chan
  [chan tenant period rollup time path data ttl]
  (>!! chan {:tenant tenant
             :period period
