[mod] simplify the xor function