worked on shutdown sequence
some cleanup