Implemented distinct read and write streams
Fixed codestyle