UI and refactoring