finnished refactoring the layouts