Improved handling of command line arguments by using argparse.