refactor of command line