Expose replaceCodes for more complex uses.