don't call indexOf twice