Fix refactored code