UI changes and minor refactoring