copymerge using a class