[Correcting] Refactoring the code in GameDAO.php