changed logic to avoid multiple datastream updates
minor restructuring
Merge pull request #117 from ajstanley/7.x

changed logic to avoid multiple datastream updates