Better client struct
Fix client/server and writing