Refactoring to use streams
Refactored to use the streams. Added throttling.
Merge remote-tracking branch 'origin/master'