Corrected some refactoring