Performance optimization by using `has` method.