starup procedure refactor