`states[ selector ] ` seems to be used  a few times and might benefit from a caching var.