Restructured Client and Server

Restructured Client and Server to be non-static and more flexible