refactoring the genome rearrangements