Consolidate several init functions into one.