refactor order of events at init