Replacement for @raoulb pr#914

See #914

ToDo:
- [x] tests
- [x] final rebase
It doesn't seems to me that we follow this convention.  But I will reorder methods.