Small refactoring of FileStream