Refactor: use a variable to store watchFile's listener