Extending caching abilities, refactoring for less code duplication and consistent usage of caching