Simplify and optimize schematic replacements