Refactory CLI.