Refactor watchr script