cleaning up handling of command line directory parameter