Small refactor in TypeExtensions.cs