Refactored AutoSwitch