[DONE] refactor pipeline