Use panel API

* Use the new panel API
* Use non-deprecated APIs