simplify logical statements