Rework ordering so things get created in the right order