Layout refactoring