some work on JS generator