refactoring in core