refactory the if-else block
keep traces on files being watched