Converted to using types in the case-of and comprises clauses.