Clean up in templates