extract pattern of checking for identifier
updated TODO