Replacing StateSet with StateTree