Use a class-based model for the state tracking.