refactoring the layouts and tests