Reordering some initialize code