refactor cli