Refactored core transition logic