created watch task and improvements in code