Update BSON creation logic