States now are named functions for easier debugging