formatting tweaks
rename state for clarity