Change argument parsing to use library