moving out method to be easier to read
Merge pull request #2749 from gogogarrett/refactor/extracting-cli-method

moving out method to be easier to read