Upgrade

* code clean-up in master chooser.
* threadifying master check