selection refactoring