wizard refactor