Minor refactoring in layouts