Code cleanup & optimizations
Fix duplicate quests bug