Boiler plate for merge function