Better caching

work in progress for a refactor for the internals wrt how the caching layer works.  

**There are currently know issues with it