This change also consists of cleaning up the server class and adding a constructor and a finalizer to it.