cleaning up some server code. No functional changes.