working on the template engine