Cancel common factors (#311)