Refactoring of SelectionTest