split out non-commandline marketplace query into separate file