This new version of the insertion looks more maintainable even if probably less fast. To be reverted if too slow.