Refactor out lodash and other extensions functions