Refactored CLI class