moved client and server out of main