Check if replacement needed; use concat/slice instead of iterating.