pass doc as parameter to private method