Refactoring the code in GameDataDAO.php