grab optimisation from upstream