I love this post from Dan about refactoring code. Dan had a project and some ugly code. He fixed the code, making it much cleaner and removing the repetition. His boss made him switch it back. Although upset at the time, Dan later came to realize his boss was right. The reasons he was right might surprise you and make you rethink your future refactoring decisions.
Goodbye, Clean Code by Dan Abramov