implemented simple tmpl engine