Refactored CLI parsing.