Improve performance of state transitions.