putting caching in a cleaner place