Many thanks for your feedback, David.
Your suggestion indded greatly improves the readability of the code.
Code corrected accordingly and rebased on top of master.