Remove some indirection in replace() docs/code.