rewrite master and workers' watcher