Replace if condition

It is more appropriated to use logical equations instead of if and returning a false/true value.
This makes the logic much harder to read at a glance, to little practical purpose.