refractoring, XOR test passed. for 我的学弟们.