Simplifying logic