make generate asynchronous (needs DRY with iter though)
...