Refactoring work on the "chain" operation.