This line is unnecessary: just use the existing `doc` from the enclosing scope.