refactor watcher