Refactored FileManager