cache functions now use cache object