refactor the command line parsing