[PROSV5]How to use C++ to design the UI program architecture?

I don’t know about LVGL, and I’m currently lumping all of my code into one class.
This class is long. The code is ugly.
And the system sensitivity is very low, estimated I did not release memory relationship.
I don’t know how to design a destructor to free memory
Do you have good architecture design to share?

The ugly architecture I designed…