Some more optimisation and comments