Added caching mechanism.