Simplification to the upsert logic.