refactor the ZMQ code to its own class