Refactor Windows support for SOC.