Adjust the state of the master according to the selection
Refactoring