Refactored core.