Refactored how hostnames, port numbers etc. are used to initialize the server.