Moved caching mechanism to separate class