major cleanup of command line arg parsing