fix some refactoring errors