Refactoring the code in GameDAO.php