Extract BSON id conversion to its own method