Better filtering upserts