refactoring cli