refactoring quizpage