rely on wrapGenerator being defined globally