Refactor the caching, include cache for activities