Slight refactoring of cockpit class