cleaned persistent watch code