refactoring core