Adding "merges" case processing. Refactoring.