some refactoring, fixed pipeline reg name numberin