Optimize the given code for better performance. Highlight any changes made and the reasoning behind them.
নতুন জেনারেটর ও প্রম্পট এলেই জানিয়ে দেব।