some refactoring changes