Refactored grepResultParse