some refactoring completed