Refactoring the layout