Improved caching system.
Improved the structure of caching system.
Fixed minor bugs in the caching system.