compact the layout