4b31b39d6b
* Refactor common code into a separate function * rename vars * make sure to set the scanOptions fields * address comments