refactored core state