minor i/o improvements for reading single file