Reduce DOM writes.

Reduce panel DOM writes from 45 writes to 9 writes.