refactored CLI