optimized the layout