Refactored GUI class.