Started refactoring of UI