Refactored to make cores more observer-like.