refactor the pre_generation method.