Clean up handling of command line arguments