Main UI refactor