some refactoring for reuse