Cleaning up the template