refactoring startup/shutdown - part 1