Rearranged code blocks.