refactored simplemerge