refactor since i/o are so different operations they deserve separate classes