change parser API to use streams too