Refactor API to be more natural for io-streams (use OutputStream more)