Some code tidy
Some code tidy
Move main loop into separate private method to facilitate trapping errors and reporting NIC problem.