introduced a supervisor which makes things clearer and helped fix a generator reset bug
some comments