Some minor optimisations