Cli refactor

cli refactor is done.