Added caching for better performance