implements new caching system