some refactoring and acceleration implemented
some refactoring and acceleration implemented