Renamed addStateFactory to setStateFactory, and addSchedulerFactory to setSchedulerFactory (as you can only set one, not multiple)