fixed some refactoring errors