add template engine function