add basic reader

refacto writer