Optimise equality checks