Started to port across the caching code trying to have 100% test coverage