refine initialization flow