Refactoring, made the ui movable