FileService refactoring