Refactor command line methods