minor silly optimisations that don't affect speed all that much anyway