smarter way to detect comment