Refactored the code, autocomplete function part of the Server struct(??)