apro_gen optimization