command line refactoring