refactor pipeline to be generic