find a way to cover both server and client