Latest changes to pipeline before removing it.
Refactor for better compatibility and tests.
Remove pipeline as it is now replaced by payload.