these changes are too much IMHO. you are changing parts of the logic of contacts merging