simplifying logic