**Describe the bug** Some asTypeOf could be avoided **To Reproduce** - function returns are cast even with the right type - subfields might be cast uselessly **Expected behavior** The right amount of casts