common utilities between server/client