server shutdown refactoring
more client stuff