Use non-deprecated version of state model factory for tasks