Caching and logging added