Refactored argparse to make it easier to do arguments checking.