Added replace chain utility