Added ordering of startup and shutdown tasks