simplify generateReplacements