More defines and rearranges