Add caching to improve performance