new method for caching elements