I can change the parameter of the function to `piece`, and the others to `cur_piece`. Is it better? Is it sufficient?

In fact, every `p` is the piece in the pipe of the transformation. In Haskell, it would be done using composition of function without explicit argument.