Refactoring layout