refactor zeromq in tests