Refactor maybe_adjust_large_object() and copy_large_object()