Store all state in a struct