refactoring around UI