Refactor FileUtils.