Refactor to make the logic more clearer
Refactor and add test case to ReorderList