Replacing custom functions with lodash and fs equivalents.