Equality instead of isInstanceOf, when possible