Optimize level generator