smarter instance checking.