Refactoring the quiz