Can you optimize this replace code?

Printable View