refactoring and ui fixes