Fix refactoring mistakes