ui update and refactoring