structural refactoring to command line parameter parsing