Re-writing is cheaper than refactoring legacy code