Cleaning up ordering of code to make better sense of the order in which stuff should and will be run.