Finished refactoring of UI