some layout optimizations