More optimisations for #20