some refactoring

some refactoring