Clean up for `document` module