refactoring of zmq tests