change to a global factory to generate numbering, and also change the way to mark the arg-derived flag