remove duplicate calls to strcmp