refactoring FileManager