Does it make sense for groupIsValid to do the null check too?