slightly shorten code in Extensions.cs
add small helper functions for types