logic simplification