Fixed refactoring errors