Reduce array allocs in #states method.