Refactored CLI clean command