modified ui
a bit of refactoring