Refactored handling command line parameters