generalized client/server code and added concurrent module