Simplify a bit the code of r106025