Features/optimise row definitions generation

Hi Guy,

Here's just some code factorisation that I did prior to adding a new feature.

Feel free to merge or not.

Regards,

David