add generator support (experimental)