use streams instead of readers