refactor the ui of the widget