Refactored GUI control