Refactoring the code in PlayerDAO.php