Moved Doc to common.
Moved to_doc method to common.