UI changes and refactored code