Clean up template layout