Using agents as an abstraction around states