Refactor watcher list javascript.