simplify conditions in utils.network due to short-circuit eval