Use streaming interface
Merge pull request #173 from kevva/rewrite

Use streaming interface