If it were me I'd write a class for each manner
of scanning. Then your script can use the appropriate
classes(you could have this be based upon a config
file if you want), which register themselves with a base class.
Scanning then simply requires the base class to
try each of the registered sub-classes.