refactor file_watcher