How do you handle refactoring and legacy code?