refactored FileHelper.