Cleaning up template