init and set_up generator refactoring