Convert type merge to a protocol