clean up template