replaced dynamic cast check with typemask check. much faster.