Split merge function into mergeObject & mergeArray