minor bug fixes, ui changes, and refactoring