refactor command line creation