optimized for templates