Refactor code to use reader and writer as terms
gendocs