working with a template