refactored test client and server stop