refine init script