VID-1841 Use more efficient search/replace function