optimize xtemplate for nodejs