Refactor factorizer merge.