Replace if condition

It is more appropriated to use logical equations instead of if and returning a false/true value.