refactor to use AddIfHasData utility method