refactor doRead method
rework doWrite method