refactor out mock require