Factor out common code between XXSort traits into smaller traits