Revert "Merge pull request #10165 from comoyo/replace_surrounding"

This reverts commit 181f88ac62bf16499653b4d1124b87adc9c85ca6, reversing
changes made to 123a145107584791355270a75317c0e1d1c700e7.