A few small optimisations