Add support for states in addition to activities.