refactored watcher and tests.