working on templates and response functions