Refactor php getQuizzes