simpler code logic and streaming support
Merge pull request #1 from ISN-Zurich/master

simpler code logic and streaming support