Implemented better caching