Minor UI fixes and refactoring.