remove duplicate negation and unneeded return statement