CLI refactored