refactoring global UI