UI improvements, a bit of refactoring