finxing refactoring bugs