Rearrange some of the initialization functions so that the allocation of arrays and initialization values are separated