Update to use streams instead of SplFile