Another way to implement smart templates is to use XSLT, which is both standardized as well as longtime proven. XSLT is used commonly used with XML but with DefiantJS, it's trivial to transform JSON structures with XSL (additionally, it's possible to search JSON structures with XPath queries using this lib; http://defiantjs.com/#xpath_evaluator).