Clean up parseOpts scanning by introducing scanner type