Refactoring to use argparse instead of optparse and Python naming style.