passing pipeline-state trough context to reduce global state and make it more testable