Hello! can you please help me clean up my code?

I was trying to create cookie clicker, but it keeps on crashing my companion app when I move to a different screen. can you help me shorten my code so that the app will not crash

my code:

I can't test without an .aia export, but I am guessing from your blocks that you did not disable your Clock Timer(s) before switching screens.

Also, the Companion does not handle Screen switching well.

Your app is simple enough to use virtual screens (stacked Vertical Arrangements, only one visible at a time.)

thank you for the advice ABG!