Modified cache implementation