add initialization blocks when flattening components.