copy/pasted quickmerge stuff to be changed in accordance to new structure