refactor runstream