The best way to improve a program is to rewrite it.
Sometimes the simplest designs are the most robust.