Layout and refactoring