I've tried to update this whilst keeping the benefits from #862. I hope @ajdawson and @jkettleb are happy with the result!