Refactoring in chain switch mechanism.