rework word replace method