Rearranges order of declarations to avoid incomplete type error.