Adding file streams, small refactor, need to fix tests