In .NET 4.5 (which we use), there's strongly typed extension methods for `GetCustomAttribute<T>` which does the same as this line. We should use that here, as well as the other places where custom attributes are retrieved...