Refactoring of selection planning