did some small optimisation