better handling of command-line parameters