Rearrange code and text to make it more logical.