some refactoring for basic
some refactoring for basic