refactoring command line parameter parsing