Rearranging code to support the markdown structure better.