Optimize templated view