How would you approach writing clean, maintainable code when working with legacy enterprise software?