Make #partially_update_document less complex