Clean legacy code