optimized the compiled template