Clean the template