more tidying and refactoring - split caching implementations