Use union instead of array_merge when possible