layout refactoring