refactoring layouts