Observation made in Document class

Assignment of variables was missing, and to avoid  duplicaation of code,
a suggestion has been put forward.