Separating Xor handling into two files