various layout optimizations