performance improvement

added caching elements