abstract the read / write in server client