redundant
* refs #17, refs #18
* use argparse package
* refactor several common code blocks