Rearranged code