Moved mergeObjects to helpers file