Refactor rangewizard js