Refactored for code review with Sanda

Hi Sanda,

Made a few alternative suggestions - see what you think.

Cheers
Roi