client/server common code