pulled out reader/writer class