[refactor] Implement caching