Merged filteredReplace instruction into replace, as it does not add much overhead to the ordinary replace call.