modifications to be compliant with -Weffc++ option (L. Gaudichet)