more optimizations to upsert.