First implementation of #8936