refactor pipeline architecture