Quest refactoring and cleaning