Refactorings in core package