minor refactoring of FileManager