Refactoring with failed tests