more stable, better shutdown sequence