fix #2 - optimize memory by reusing the panels
improving code