refactored quiz demo