Decoupled creation of scanner from command line