Refactored the state again.