[SourceSwitch] Refactor a piece of code.