update command line arguments, cleanup code