Speed tweaks and tidy