optimized replacement-rules + graphical visualization