Changed caching system (not tested yet)