refactor watcher and matching
Merge pull request #641 from guard/minor_refactoring

refactor watcher and matching