fix infinite stream of nil when channel closes
refactored basic dataflow for vizualizer