element caching refactor