Refactored CLI, misc