Improved is() method