Updates if-check to be simpler and less fragile

- String comparison does not generate compiler warning if we change the
variable name in the future
- Plain pointer comparison is more efficient than string comparison