refactoring, some UI improvements