Basic layout logic.