improve generation module