refactor the google doc agent module