refactoring ui layout