Allow custom merge function