Fix compilation errors with Refactoring