Refactored ParseCommandOutput