clean code, extract variable and invert equals