Optimise calculation of size