Refactored the layout logic