command line processing for easier testing