Refactoring ControlPanel