Clean up template rendering.