Changed structre, merged server and client