startup procedure refactor