minor wizards.js code refactoring