Add support for generators