refactor pipeline to "insert array" way