a couple more optimisations made