Refactored disconnectPins.