minor grepl optimization