use equals operator instead of Type.IsEquivalentTo

feedback from an earlier codereview.