refactored cli