change method to class for creating servers.