You already do this before assigning `$state`. Duplicate code?