refactor quizCtrl