Minor refactoring and cleanups. Added ControlPanel controller.