some micro-optimisations