Simplify modulo tests