Simplify computation of relevant terms in datatypes (#6885)