Update to layout logic