Refactored GUI by separating the mode switcher.