improved command line handling