clean up template rendering