some extern refactoring in place
extern refactoring