some minor optimisation