Refactored how commands are parsed