Convert to use methods from fileutil.