Increased efficiency of has method