cleaning up the template