improve iteration panel code