refactoring bug squash