Refactoring the code in Referee.php