Add formatOr and factorize code with formatAnd