refactoring the watcher