updated gdocs code to use ORM