Server and client converted to oop