Do replacements first