[StateManager] refactored;