This would be my code. Refactoring of this should be the case of another commit.
Maybe once we have the new parser.
There is a bit of duplication because things are slightly different in terms of disambiguation filters and (in the future) parsers that we call.