Smarter type filtering in the get type method.