Cleaning up template layout