Refactor merge collector