small code rearrangement, avoid re-checksumming