Ui refactoring and logout