First implementation for #3916.
Waiting for a complete rework