update to template caching