cleaning up template