Rearranged section for changing wikitext to deal with different conditions