in reply to code critique

Here are a few suggestions:-

I hope these points are helpful.

Cheers,

JohnGG