Refactoring core