Minor UI changes and code refactoring