Refactored a smaller core.