fixed definition of autogenerated factory