Refactor _panelEdit