Extracting a function to start the server