Refactored into PanelController