Refactoring bug