UI tweaks and refactoring