refactoring, various UI enhancements