refactored File methods