Minor code rearranging.