Move panel stuff to separate file