Caching results to improve performance.