consolidated code that should NOT be run every time into resetServer