updated template engine