More code rearranging