refactor: in generate_diffs, isolated parsing the hunk