refactoring for zmap