Refactor methods out of streams.coffee