Refactored mastermindUI