added caching to increase performance