Refactor to use ResultDocSet instead of PairFile.