Minimal refactoring of layout