a bit of optimisation